From dec4191be92071194f0af8235c81e6fe60349295 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 7 Nov 2025 14:43:40 -0800 Subject: [PATCH 1/4] chore(cupertino_http): Switch to objective_c 9.0.0 --- .../native_cupertino_bindings.m | 424 +- .../cupertino_http/lib/src/cupertino_api.dart | 24 +- .../lib/src/native_cupertino_bindings.dart | 50497 ++++++++-------- pkgs/cupertino_http/pubspec.yaml | 4 +- 4 files changed, 25762 insertions(+), 25187 deletions(-) diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m index f961e247f8..8c711fd3fb 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -59,19 +59,19 @@ }; -typedef void (^ListenerTrampoline)(); +typedef void (^_ListenerTrampoline)(); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(ListenerTrampoline block) NS_RETURNS_RETAINED { +_ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(_ListenerTrampoline block) NS_RETURNS_RETAINED { return ^void() { objc_retainBlock(block); block(); }; } -typedef void (^BlockingTrampoline)(void * waiter); +typedef void (^_BlockingTrampoline)(void * waiter); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( - BlockingTrampoline block, BlockingTrampoline listenerBlock, +_ListenerTrampoline _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( + _BlockingTrampoline block, _BlockingTrampoline listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(), { objc_retainBlock(block); @@ -82,99 +82,95 @@ ListenerTrampoline _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( }); } -typedef void (^ListenerTrampoline_1)(id arg0); +typedef BOOL (^_ProtocolTrampoline)(void * sel); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_1 _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(ListenerTrampoline_1 block) NS_RETURNS_RETAINED { - return ^void(id arg0) { +BOOL _NativeCupertinoHttp_protocolTrampoline_e3qsqz(id target, void * sel) { + return ((_ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); +} + +typedef void (^_ListenerTrampoline_1)(void * arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) +_ListenerTrampoline_1 _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(_ListenerTrampoline_1 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1) { objc_retainBlock(block); - block((__bridge id)(__bridge_retained void*)(arg0)); + block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^BlockingTrampoline_1)(void * waiter, id arg0); +typedef void (^_BlockingTrampoline_1)(void * waiter, void * arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_1 _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - BlockingTrampoline_1 block, BlockingTrampoline_1 listenerBlock, +_ListenerTrampoline_1 _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( + _BlockingTrampoline_1 block, _BlockingTrampoline_1 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0), { + BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1), { objc_retainBlock(block); - block(nil, (__bridge id)(__bridge_retained void*)(arg0)); + block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); }, { objc_retainBlock(listenerBlock); - listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0)); + listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); }); } -typedef BOOL (^ProtocolTrampoline)(void * sel); +typedef void (^_ProtocolTrampoline_1)(void * sel, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -BOOL _NativeCupertinoHttp_protocolTrampoline_e3qsqz(id target, void * sel) { - return ((ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); +void _NativeCupertinoHttp_protocolTrampoline_18v1jvf(id target, void * sel, id arg1) { + return ((_ProtocolTrampoline_1)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef id (^ProtocolTrampoline_1)(void * sel); +typedef id (^_ProtocolTrampoline_2)(void * sel, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -id _NativeCupertinoHttp_protocolTrampoline_1mbt9g9(id target, void * sel) { - return ((ProtocolTrampoline_1)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); +id _NativeCupertinoHttp_protocolTrampoline_xr62hr(id target, void * sel, id arg1) { + return ((_ProtocolTrampoline_2)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef void (^ListenerTrampoline_2)(void * arg0, id arg1); +typedef void (^_ListenerTrampoline_2)(id arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_2 _NativeCupertinoHttp_wrapListenerBlock_18v1jvf(ListenerTrampoline_2 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1) { +_ListenerTrampoline_2 _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(_ListenerTrampoline_2 block) NS_RETURNS_RETAINED { + return ^void(id arg0) { objc_retainBlock(block); - block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); + block((__bridge id)(__bridge_retained void*)(arg0)); }; } -typedef void (^BlockingTrampoline_2)(void * waiter, void * arg0, id arg1); +typedef void (^_BlockingTrampoline_2)(void * waiter, id arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_2 _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( - BlockingTrampoline_2 block, BlockingTrampoline_2 listenerBlock, +_ListenerTrampoline_2 _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + _BlockingTrampoline_2 block, _BlockingTrampoline_2 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1), { + BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0), { objc_retainBlock(block); - block(nil, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + block(nil, (__bridge id)(__bridge_retained void*)(arg0)); }, { objc_retainBlock(listenerBlock); - listenerBlock(waiter, arg0, (__bridge id)(__bridge_retained void*)(arg1)); + listenerBlock(waiter, (__bridge id)(__bridge_retained void*)(arg0)); }); } -typedef void (^ProtocolTrampoline_2)(void * sel, id arg1); +typedef id (^_ProtocolTrampoline_3)(void * sel); __attribute__((visibility("default"))) __attribute__((used)) -void _NativeCupertinoHttp_protocolTrampoline_18v1jvf(id target, void * sel, id arg1) { - return ((ProtocolTrampoline_2)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); +id _NativeCupertinoHttp_protocolTrampoline_1mbt9g9(id target, void * sel) { + return ((_ProtocolTrampoline_3)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); } -typedef id (^ProtocolTrampoline_3)(void * sel, id arg1); -__attribute__((visibility("default"))) __attribute__((used)) -id _NativeCupertinoHttp_protocolTrampoline_xr62hr(id target, void * sel, id arg1) { - return ((ProtocolTrampoline_3)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); -} - -Protocol* _NativeCupertinoHttp_NSProgressReporting(void) { return @protocol(NSProgressReporting); } - -Protocol* _NativeCupertinoHttp_NSURLSessionTaskDelegate(void) { return @protocol(NSURLSessionTaskDelegate); } - -typedef unsigned long (^ProtocolTrampoline_4)(void * sel, NSFastEnumerationState * arg1, id * arg2, unsigned long arg3); +typedef unsigned long (^_ProtocolTrampoline_4)(void * sel, NSFastEnumerationState * arg1, id * arg2, unsigned long arg3); __attribute__((visibility("default"))) __attribute__((used)) unsigned long _NativeCupertinoHttp_protocolTrampoline_17ap02x(id target, void * sel, NSFastEnumerationState * arg1, id * arg2, unsigned long arg3) { - return ((ProtocolTrampoline_4)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); + return ((_ProtocolTrampoline_4)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^ListenerTrampoline_3)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +typedef void (^_ListenerTrampoline_3)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_3 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(ListenerTrampoline_3 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_3 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(_ListenerTrampoline_3 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^BlockingTrampoline_3)(void * waiter, struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +typedef void (^_BlockingTrampoline_3)(void * waiter, struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_3 _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( - BlockingTrampoline_3 block, BlockingTrampoline_3 listenerBlock, +_ListenerTrampoline_3 _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( + _BlockingTrampoline_3 block, _BlockingTrampoline_3 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1), { objc_retainBlock(block); @@ -185,19 +181,19 @@ ListenerTrampoline_3 _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( }); } -typedef void (^ListenerTrampoline_4)(struct __CFRunLoopTimer * arg0); +typedef void (^_ListenerTrampoline_4)(struct __CFRunLoopTimer * arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_4 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(ListenerTrampoline_4 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_4 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(_ListenerTrampoline_4 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopTimer * arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_4)(void * waiter, struct __CFRunLoopTimer * arg0); +typedef void (^_BlockingTrampoline_4)(void * waiter, struct __CFRunLoopTimer * arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_4 _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( - BlockingTrampoline_4 block, BlockingTrampoline_4 listenerBlock, +_ListenerTrampoline_4 _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( + _BlockingTrampoline_4 block, _BlockingTrampoline_4 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(struct __CFRunLoopTimer * arg0), { objc_retainBlock(block); @@ -208,19 +204,19 @@ ListenerTrampoline_4 _NativeCupertinoHttp_wrapBlockingBlock_1dqvvol( }); } -typedef void (^ListenerTrampoline_5)(size_t arg0); +typedef void (^_ListenerTrampoline_5)(size_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_5 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(ListenerTrampoline_5 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_5 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(_ListenerTrampoline_5 block) NS_RETURNS_RETAINED { return ^void(size_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_5)(void * waiter, size_t arg0); +typedef void (^_BlockingTrampoline_5)(void * waiter, size_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_5 _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( - BlockingTrampoline_5 block, BlockingTrampoline_5 listenerBlock, +_ListenerTrampoline_5 _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( + _BlockingTrampoline_5 block, _BlockingTrampoline_5 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(size_t arg0), { objc_retainBlock(block); @@ -231,19 +227,19 @@ ListenerTrampoline_5 _NativeCupertinoHttp_wrapBlockingBlock_6enxqz( }); } -typedef void (^ListenerTrampoline_6)(id arg0, int arg1); +typedef void (^_ListenerTrampoline_6)(id arg0, int arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_6 _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(ListenerTrampoline_6 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_6 _NativeCupertinoHttp_wrapListenerBlock_18kzm6a(_ListenerTrampoline_6 block) NS_RETURNS_RETAINED { return ^void(id arg0, int arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), arg1); }; } -typedef void (^BlockingTrampoline_6)(void * waiter, id arg0, int arg1); +typedef void (^_BlockingTrampoline_6)(void * waiter, id arg0, int arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_6 _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( - BlockingTrampoline_6 block, BlockingTrampoline_6 listenerBlock, +_ListenerTrampoline_6 _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( + _BlockingTrampoline_6 block, _BlockingTrampoline_6 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, int arg1), { objc_retainBlock(block); @@ -254,19 +250,19 @@ ListenerTrampoline_6 _NativeCupertinoHttp_wrapBlockingBlock_18kzm6a( }); } -typedef void (^ListenerTrampoline_7)(int arg0); +typedef void (^_ListenerTrampoline_7)(int arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_7 _NativeCupertinoHttp_wrapListenerBlock_9o8504(ListenerTrampoline_7 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_7 _NativeCupertinoHttp_wrapListenerBlock_9o8504(_ListenerTrampoline_7 block) NS_RETURNS_RETAINED { return ^void(int arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_7)(void * waiter, int arg0); +typedef void (^_BlockingTrampoline_7)(void * waiter, int arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_7 _NativeCupertinoHttp_wrapBlockingBlock_9o8504( - BlockingTrampoline_7 block, BlockingTrampoline_7 listenerBlock, +_ListenerTrampoline_7 _NativeCupertinoHttp_wrapBlockingBlock_9o8504( + _BlockingTrampoline_7 block, _BlockingTrampoline_7 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(int arg0), { objc_retainBlock(block); @@ -277,19 +273,19 @@ ListenerTrampoline_7 _NativeCupertinoHttp_wrapBlockingBlock_9o8504( }); } -typedef void (^ListenerTrampoline_8)(BOOL arg0, id arg1, int arg2); +typedef void (^_ListenerTrampoline_8)(BOOL arg0, id arg1, int arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_8 _NativeCupertinoHttp_wrapListenerBlock_og5b6y(ListenerTrampoline_8 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_8 _NativeCupertinoHttp_wrapListenerBlock_og5b6y(_ListenerTrampoline_8 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0, id arg1, int arg2) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), arg2); }; } -typedef void (^BlockingTrampoline_8)(void * waiter, BOOL arg0, id arg1, int arg2); +typedef void (^_BlockingTrampoline_8)(void * waiter, BOOL arg0, id arg1, int arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_8 _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( - BlockingTrampoline_8 block, BlockingTrampoline_8 listenerBlock, +_ListenerTrampoline_8 _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( + _BlockingTrampoline_8 block, _BlockingTrampoline_8 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(BOOL arg0, id arg1, int arg2), { objc_retainBlock(block); @@ -300,19 +296,19 @@ ListenerTrampoline_8 _NativeCupertinoHttp_wrapBlockingBlock_og5b6y( }); } -typedef void (^ListenerTrampoline_9)(struct __SecTrust * arg0, SecTrustResultType arg1); +typedef void (^_ListenerTrampoline_9)(struct __SecTrust * arg0, SecTrustResultType arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_9 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(ListenerTrampoline_9 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_9 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(_ListenerTrampoline_9 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^BlockingTrampoline_9)(void * waiter, struct __SecTrust * arg0, SecTrustResultType arg1); +typedef void (^_BlockingTrampoline_9)(void * waiter, struct __SecTrust * arg0, SecTrustResultType arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_9 _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( - BlockingTrampoline_9 block, BlockingTrampoline_9 listenerBlock, +_ListenerTrampoline_9 _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( + _BlockingTrampoline_9 block, _BlockingTrampoline_9 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(struct __SecTrust * arg0, SecTrustResultType arg1), { objc_retainBlock(block); @@ -323,19 +319,19 @@ ListenerTrampoline_9 _NativeCupertinoHttp_wrapBlockingBlock_gwxhxt( }); } -typedef void (^ListenerTrampoline_10)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +typedef void (^_ListenerTrampoline_10)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_10 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(ListenerTrampoline_10 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_10 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(_ListenerTrampoline_10 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { objc_retainBlock(block); block(arg0, arg1, arg2); }; } -typedef void (^BlockingTrampoline_10)(void * waiter, struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +typedef void (^_BlockingTrampoline_10)(void * waiter, struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_10 _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( - BlockingTrampoline_10 block, BlockingTrampoline_10 listenerBlock, +_ListenerTrampoline_10 _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( + _BlockingTrampoline_10 block, _BlockingTrampoline_10 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2), { objc_retainBlock(block); @@ -346,19 +342,19 @@ ListenerTrampoline_10 _NativeCupertinoHttp_wrapBlockingBlock_k73ff5( }); } -typedef void (^ListenerTrampoline_11)(uint16_t arg0); +typedef void (^_ListenerTrampoline_11)(uint16_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_11 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(ListenerTrampoline_11 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_11 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(_ListenerTrampoline_11 block) NS_RETURNS_RETAINED { return ^void(uint16_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_11)(void * waiter, uint16_t arg0); +typedef void (^_BlockingTrampoline_11)(void * waiter, uint16_t arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_11 _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( - BlockingTrampoline_11 block, BlockingTrampoline_11 listenerBlock, +_ListenerTrampoline_11 _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( + _BlockingTrampoline_11 block, _BlockingTrampoline_11 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(uint16_t arg0), { objc_retainBlock(block); @@ -369,19 +365,19 @@ ListenerTrampoline_11 _NativeCupertinoHttp_wrapBlockingBlock_15f11yh( }); } -typedef void (^ListenerTrampoline_12)(id arg0, id arg1); +typedef void (^_ListenerTrampoline_12)(id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_12 _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(ListenerTrampoline_12 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_12 _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(_ListenerTrampoline_12 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^BlockingTrampoline_12)(void * waiter, id arg0, id arg1); +typedef void (^_BlockingTrampoline_12)(void * waiter, id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_12 _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( - BlockingTrampoline_12 block, BlockingTrampoline_12 listenerBlock, +_ListenerTrampoline_12 _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + _BlockingTrampoline_12 block, _BlockingTrampoline_12 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1), { objc_retainBlock(block); @@ -392,19 +388,19 @@ ListenerTrampoline_12 _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( }); } -typedef void (^ListenerTrampoline_13)(id arg0, id arg1, id arg2); +typedef void (^_ListenerTrampoline_13)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_13 _NativeCupertinoHttp_wrapListenerBlock_18qun1e(ListenerTrampoline_13 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_13 _NativeCupertinoHttp_wrapListenerBlock_18qun1e(_ListenerTrampoline_13 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), objc_retainBlock(arg2)); }; } -typedef void (^BlockingTrampoline_13)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^_BlockingTrampoline_13)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_13 _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( - BlockingTrampoline_13 block, BlockingTrampoline_13 listenerBlock, +_ListenerTrampoline_13 _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( + _BlockingTrampoline_13 block, _BlockingTrampoline_13 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { objc_retainBlock(block); @@ -415,19 +411,19 @@ ListenerTrampoline_13 _NativeCupertinoHttp_wrapBlockingBlock_18qun1e( }); } -typedef void (^ListenerTrampoline_14)(id arg0, id arg1); +typedef void (^_ListenerTrampoline_14)(id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_14 _NativeCupertinoHttp_wrapListenerBlock_o762yo(ListenerTrampoline_14 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_14 _NativeCupertinoHttp_wrapListenerBlock_o762yo(_ListenerTrampoline_14 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), objc_retainBlock(arg1)); }; } -typedef void (^BlockingTrampoline_14)(void * waiter, id arg0, id arg1); +typedef void (^_BlockingTrampoline_14)(void * waiter, id arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_14 _NativeCupertinoHttp_wrapBlockingBlock_o762yo( - BlockingTrampoline_14 block, BlockingTrampoline_14 listenerBlock, +_ListenerTrampoline_14 _NativeCupertinoHttp_wrapBlockingBlock_o762yo( + _BlockingTrampoline_14 block, _BlockingTrampoline_14 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1), { objc_retainBlock(block); @@ -438,19 +434,19 @@ ListenerTrampoline_14 _NativeCupertinoHttp_wrapBlockingBlock_o762yo( }); } -typedef void (^ListenerTrampoline_15)(BOOL arg0); +typedef void (^_ListenerTrampoline_15)(BOOL arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_15 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(ListenerTrampoline_15 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_15 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(_ListenerTrampoline_15 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_15)(void * waiter, BOOL arg0); +typedef void (^_BlockingTrampoline_15)(void * waiter, BOOL arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_15 _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( - BlockingTrampoline_15 block, BlockingTrampoline_15 listenerBlock, +_ListenerTrampoline_15 _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( + _BlockingTrampoline_15 block, _BlockingTrampoline_15 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(BOOL arg0), { objc_retainBlock(block); @@ -461,19 +457,19 @@ ListenerTrampoline_15 _NativeCupertinoHttp_wrapBlockingBlock_1s56lr9( }); } -typedef void (^ListenerTrampoline_16)(id arg0, id arg1, id arg2); +typedef void (^_ListenerTrampoline_16)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_16 _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(ListenerTrampoline_16 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_16 _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(_ListenerTrampoline_16 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block((__bridge id)(__bridge_retained void*)(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^BlockingTrampoline_16)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^_BlockingTrampoline_16)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_16 _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( - BlockingTrampoline_16 block, BlockingTrampoline_16 listenerBlock, +_ListenerTrampoline_16 _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + _BlockingTrampoline_16 block, _BlockingTrampoline_16 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { objc_retainBlock(block); @@ -484,21 +480,19 @@ ListenerTrampoline_16 _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( }); } -Protocol* _NativeCupertinoHttp_NSURLSessionDelegate(void) { return @protocol(NSURLSessionDelegate); } - -typedef void (^ListenerTrampoline_17)(NSURLSessionResponseDisposition arg0); +typedef void (^_ListenerTrampoline_17)(NSURLSessionResponseDisposition arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_17 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(ListenerTrampoline_17 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_17 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(_ListenerTrampoline_17 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionResponseDisposition arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_17)(void * waiter, NSURLSessionResponseDisposition arg0); +typedef void (^_BlockingTrampoline_17)(void * waiter, NSURLSessionResponseDisposition arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_17 _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( - BlockingTrampoline_17 block, BlockingTrampoline_17 listenerBlock, +_ListenerTrampoline_17 _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( + _BlockingTrampoline_17 block, _BlockingTrampoline_17 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionResponseDisposition arg0), { objc_retainBlock(block); @@ -509,19 +503,19 @@ ListenerTrampoline_17 _NativeCupertinoHttp_wrapBlockingBlock_16sve1d( }); } -typedef void (^ListenerTrampoline_18)(NSURLSessionDelayedRequestDisposition arg0, id arg1); +typedef void (^_ListenerTrampoline_18)(NSURLSessionDelayedRequestDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_18 _NativeCupertinoHttp_wrapListenerBlock_1otpo83(ListenerTrampoline_18 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_18 _NativeCupertinoHttp_wrapListenerBlock_1otpo83(_ListenerTrampoline_18 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^BlockingTrampoline_18)(void * waiter, NSURLSessionDelayedRequestDisposition arg0, id arg1); +typedef void (^_BlockingTrampoline_18)(void * waiter, NSURLSessionDelayedRequestDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_18 _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( - BlockingTrampoline_18 block, BlockingTrampoline_18 listenerBlock, +_ListenerTrampoline_18 _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( + _BlockingTrampoline_18 block, _BlockingTrampoline_18 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1), { objc_retainBlock(block); @@ -532,19 +526,19 @@ ListenerTrampoline_18 _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( }); } -typedef void (^ListenerTrampoline_19)(void * arg0, id arg1, id arg2, id arg3, id arg4); +typedef void (^_ListenerTrampoline_19)(void * arg0, id arg1, id arg2, id arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_19 _NativeCupertinoHttp_wrapListenerBlock_xx612k(ListenerTrampoline_19 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_19 _NativeCupertinoHttp_wrapListenerBlock_xx612k(_ListenerTrampoline_19 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), objc_retainBlock(arg4)); }; } -typedef void (^BlockingTrampoline_19)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4); +typedef void (^_BlockingTrampoline_19)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_19 _NativeCupertinoHttp_wrapBlockingBlock_xx612k( - BlockingTrampoline_19 block, BlockingTrampoline_19 listenerBlock, +_ListenerTrampoline_19 _NativeCupertinoHttp_wrapBlockingBlock_xx612k( + _BlockingTrampoline_19 block, _BlockingTrampoline_19 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3, id arg4), { objc_retainBlock(block); @@ -555,25 +549,25 @@ ListenerTrampoline_19 _NativeCupertinoHttp_wrapBlockingBlock_xx612k( }); } -typedef void (^ProtocolTrampoline_5)(void * sel, id arg1, id arg2, id arg3, id arg4); +typedef void (^_ProtocolTrampoline_5)(void * sel, id arg1, id arg2, id arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_xx612k(id target, void * sel, id arg1, id arg2, id arg3, id arg4) { - return ((ProtocolTrampoline_5)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); + return ((_ProtocolTrampoline_5)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } -typedef void (^ListenerTrampoline_20)(void * arg0, id arg1, id arg2, id arg3); +typedef void (^_ListenerTrampoline_20)(void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_20 _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(ListenerTrampoline_20 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_20 _NativeCupertinoHttp_wrapListenerBlock_1tz5yf(_ListenerTrampoline_20 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3)); }; } -typedef void (^BlockingTrampoline_20)(void * waiter, void * arg0, id arg1, id arg2, id arg3); +typedef void (^_BlockingTrampoline_20)(void * waiter, void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_20 _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( - BlockingTrampoline_20 block, BlockingTrampoline_20 listenerBlock, +_ListenerTrampoline_20 _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( + _BlockingTrampoline_20 block, _BlockingTrampoline_20 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3), { objc_retainBlock(block); @@ -584,25 +578,25 @@ ListenerTrampoline_20 _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( }); } -typedef void (^ProtocolTrampoline_6)(void * sel, id arg1, id arg2, id arg3); +typedef void (^_ProtocolTrampoline_6)(void * sel, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_1tz5yf(id target, void * sel, id arg1, id arg2, id arg3) { - return ((ProtocolTrampoline_6)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); + return ((_ProtocolTrampoline_6)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^ListenerTrampoline_21)(void * arg0, id arg1, id arg2); +typedef void (^_ListenerTrampoline_21)(void * arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_21 _NativeCupertinoHttp_wrapListenerBlock_fjrv01(ListenerTrampoline_21 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_21 _NativeCupertinoHttp_wrapListenerBlock_fjrv01(_ListenerTrampoline_21 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^BlockingTrampoline_21)(void * waiter, void * arg0, id arg1, id arg2); +typedef void (^_BlockingTrampoline_21)(void * waiter, void * arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_21 _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( - BlockingTrampoline_21 block, BlockingTrampoline_21 listenerBlock, +_ListenerTrampoline_21 _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( + _BlockingTrampoline_21 block, _BlockingTrampoline_21 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2), { objc_retainBlock(block); @@ -613,25 +607,25 @@ ListenerTrampoline_21 _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( }); } -typedef void (^ProtocolTrampoline_7)(void * sel, id arg1, id arg2); +typedef void (^_ProtocolTrampoline_7)(void * sel, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_fjrv01(id target, void * sel, id arg1, id arg2) { - return ((ProtocolTrampoline_7)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); + return ((_ProtocolTrampoline_7)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); } -typedef void (^ListenerTrampoline_22)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +typedef void (^_ListenerTrampoline_22)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_22 _NativeCupertinoHttp_wrapListenerBlock_l2g8ke(ListenerTrampoline_22 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_22 _NativeCupertinoHttp_wrapListenerBlock_l2g8ke(_ListenerTrampoline_22 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), (__bridge id)(__bridge_retained void*)(arg3), (__bridge id)(__bridge_retained void*)(arg4), objc_retainBlock(arg5)); }; } -typedef void (^BlockingTrampoline_22)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +typedef void (^_BlockingTrampoline_22)(void * waiter, void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_22 _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( - BlockingTrampoline_22 block, BlockingTrampoline_22 listenerBlock, +_ListenerTrampoline_22 _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( + _BlockingTrampoline_22 block, _BlockingTrampoline_22 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5), { objc_retainBlock(block); @@ -642,25 +636,25 @@ ListenerTrampoline_22 _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( }); } -typedef void (^ProtocolTrampoline_8)(void * sel, id arg1, id arg2, id arg3, id arg4, id arg5); +typedef void (^_ProtocolTrampoline_8)(void * sel, id arg1, id arg2, id arg3, id arg4, id arg5); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_l2g8ke(id target, void * sel, id arg1, id arg2, id arg3, id arg4, id arg5) { - return ((ProtocolTrampoline_8)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); + return ((_ProtocolTrampoline_8)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); } -typedef void (^ListenerTrampoline_23)(NSURLSessionAuthChallengeDisposition arg0, id arg1); +typedef void (^_ListenerTrampoline_23)(NSURLSessionAuthChallengeDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_23 _NativeCupertinoHttp_wrapListenerBlock_n8yd09(ListenerTrampoline_23 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_23 _NativeCupertinoHttp_wrapListenerBlock_n8yd09(_ListenerTrampoline_23 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1)); }; } -typedef void (^BlockingTrampoline_23)(void * waiter, NSURLSessionAuthChallengeDisposition arg0, id arg1); +typedef void (^_BlockingTrampoline_23)(void * waiter, NSURLSessionAuthChallengeDisposition arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_23 _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( - BlockingTrampoline_23 block, BlockingTrampoline_23 listenerBlock, +_ListenerTrampoline_23 _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( + _BlockingTrampoline_23 block, _BlockingTrampoline_23 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1), { objc_retainBlock(block); @@ -671,19 +665,19 @@ ListenerTrampoline_23 _NativeCupertinoHttp_wrapBlockingBlock_n8yd09( }); } -typedef void (^ListenerTrampoline_24)(void * arg0, id arg1, id arg2, id arg3); +typedef void (^_ListenerTrampoline_24)(void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_24 _NativeCupertinoHttp_wrapListenerBlock_bklti2(ListenerTrampoline_24 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_24 _NativeCupertinoHttp_wrapListenerBlock_bklti2(_ListenerTrampoline_24 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), objc_retainBlock(arg3)); }; } -typedef void (^BlockingTrampoline_24)(void * waiter, void * arg0, id arg1, id arg2, id arg3); +typedef void (^_BlockingTrampoline_24)(void * waiter, void * arg0, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_24 _NativeCupertinoHttp_wrapBlockingBlock_bklti2( - BlockingTrampoline_24 block, BlockingTrampoline_24 listenerBlock, +_ListenerTrampoline_24 _NativeCupertinoHttp_wrapBlockingBlock_bklti2( + _BlockingTrampoline_24 block, _BlockingTrampoline_24 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, id arg3), { objc_retainBlock(block); @@ -694,25 +688,25 @@ ListenerTrampoline_24 _NativeCupertinoHttp_wrapBlockingBlock_bklti2( }); } -typedef void (^ProtocolTrampoline_9)(void * sel, id arg1, id arg2, id arg3); +typedef void (^_ProtocolTrampoline_9)(void * sel, id arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_bklti2(id target, void * sel, id arg1, id arg2, id arg3) { - return ((ProtocolTrampoline_9)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); + return ((_ProtocolTrampoline_9)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef void (^ListenerTrampoline_25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +typedef void (^_ListenerTrampoline_25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_25 _NativeCupertinoHttp_wrapListenerBlock_jyim80(ListenerTrampoline_25 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_25 _NativeCupertinoHttp_wrapListenerBlock_jyim80(_ListenerTrampoline_25 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, objc_retainBlock(arg4)); }; } -typedef void (^BlockingTrampoline_25)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +typedef void (^_BlockingTrampoline_25)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_25 _NativeCupertinoHttp_wrapBlockingBlock_jyim80( - BlockingTrampoline_25 block, BlockingTrampoline_25 listenerBlock, +_ListenerTrampoline_25 _NativeCupertinoHttp_wrapBlockingBlock_jyim80( + _BlockingTrampoline_25 block, _BlockingTrampoline_25 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4), { objc_retainBlock(block); @@ -723,25 +717,25 @@ ListenerTrampoline_25 _NativeCupertinoHttp_wrapBlockingBlock_jyim80( }); } -typedef void (^ProtocolTrampoline_10)(void * sel, id arg1, id arg2, int64_t arg3, id arg4); +typedef void (^_ProtocolTrampoline_10)(void * sel, id arg1, id arg2, int64_t arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_jyim80(id target, void * sel, id arg1, id arg2, int64_t arg3, id arg4) { - return ((ProtocolTrampoline_10)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); + return ((_ProtocolTrampoline_10)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } -typedef void (^ListenerTrampoline_26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +typedef void (^_ListenerTrampoline_26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_26 _NativeCupertinoHttp_wrapListenerBlock_h68abb(ListenerTrampoline_26 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_26 _NativeCupertinoHttp_wrapListenerBlock_h68abb(_ListenerTrampoline_26 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4, arg5); }; } -typedef void (^BlockingTrampoline_26)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +typedef void (^_BlockingTrampoline_26)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_26 _NativeCupertinoHttp_wrapBlockingBlock_h68abb( - BlockingTrampoline_26 block, BlockingTrampoline_26 listenerBlock, +_ListenerTrampoline_26 _NativeCupertinoHttp_wrapBlockingBlock_h68abb( + _BlockingTrampoline_26 block, _BlockingTrampoline_26 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5), { objc_retainBlock(block); @@ -752,27 +746,27 @@ ListenerTrampoline_26 _NativeCupertinoHttp_wrapBlockingBlock_h68abb( }); } -typedef void (^ProtocolTrampoline_11)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +typedef void (^_ProtocolTrampoline_11)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_h68abb(id target, void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { - return ((ProtocolTrampoline_11)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); + return ((_ProtocolTrampoline_11)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4, arg5); } Protocol* _NativeCupertinoHttp_NSURLSessionDataDelegate(void) { return @protocol(NSURLSessionDataDelegate); } -typedef void (^ListenerTrampoline_27)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +typedef void (^_ListenerTrampoline_27)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_27 _NativeCupertinoHttp_wrapListenerBlock_ly2579(ListenerTrampoline_27 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_27 _NativeCupertinoHttp_wrapListenerBlock_ly2579(_ListenerTrampoline_27 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, arg4); }; } -typedef void (^BlockingTrampoline_27)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +typedef void (^_BlockingTrampoline_27)(void * waiter, void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_27 _NativeCupertinoHttp_wrapBlockingBlock_ly2579( - BlockingTrampoline_27 block, BlockingTrampoline_27 listenerBlock, +_ListenerTrampoline_27 _NativeCupertinoHttp_wrapBlockingBlock_ly2579( + _BlockingTrampoline_27 block, _BlockingTrampoline_27 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4), { objc_retainBlock(block); @@ -783,27 +777,27 @@ ListenerTrampoline_27 _NativeCupertinoHttp_wrapBlockingBlock_ly2579( }); } -typedef void (^ProtocolTrampoline_12)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4); +typedef void (^_ProtocolTrampoline_12)(void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_ly2579(id target, void * sel, id arg1, id arg2, int64_t arg3, int64_t arg4) { - return ((ProtocolTrampoline_12)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); + return ((_ProtocolTrampoline_12)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } Protocol* _NativeCupertinoHttp_NSURLSessionDownloadDelegate(void) { return @protocol(NSURLSessionDownloadDelegate); } -typedef void (^ListenerTrampoline_28)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +typedef void (^_ListenerTrampoline_28)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_28 _NativeCupertinoHttp_wrapListenerBlock_1lx650f(ListenerTrampoline_28 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_28 _NativeCupertinoHttp_wrapListenerBlock_1lx650f(_ListenerTrampoline_28 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { objc_retainBlock(block); block(arg0, (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2), arg3, (__bridge id)(__bridge_retained void*)(arg4)); }; } -typedef void (^BlockingTrampoline_28)(void * waiter, void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +typedef void (^_BlockingTrampoline_28)(void * waiter, void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_28 _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( - BlockingTrampoline_28 block, BlockingTrampoline_28 listenerBlock, +_ListenerTrampoline_28 _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( + _BlockingTrampoline_28 block, _BlockingTrampoline_28 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4), { objc_retainBlock(block); @@ -814,27 +808,27 @@ ListenerTrampoline_28 _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( }); } -typedef void (^ProtocolTrampoline_13)(void * sel, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +typedef void (^_ProtocolTrampoline_13)(void * sel, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_1lx650f(id target, void * sel, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { - return ((ProtocolTrampoline_13)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); + return ((_ProtocolTrampoline_13)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3, arg4); } Protocol* _NativeCupertinoHttp_NSURLSessionWebSocketDelegate(void) { return @protocol(NSURLSessionWebSocketDelegate); } -typedef void (^ListenerTrampoline_29)(id arg0, id arg1, id arg2); +typedef void (^_ListenerTrampoline_29)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_29 _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(ListenerTrampoline_29 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_29 _NativeCupertinoHttp_wrapListenerBlock_1b3bb6a(_ListenerTrampoline_29 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retainBlock(arg0), (__bridge id)(__bridge_retained void*)(arg1), (__bridge id)(__bridge_retained void*)(arg2)); }; } -typedef void (^BlockingTrampoline_29)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^_BlockingTrampoline_29)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_29 _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( - BlockingTrampoline_29 block, BlockingTrampoline_29 listenerBlock, +_ListenerTrampoline_29 _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( + _BlockingTrampoline_29 block, _BlockingTrampoline_29 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(id arg0, id arg1, id arg2), { objc_retainBlock(block); @@ -845,39 +839,37 @@ ListenerTrampoline_29 _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( }); } -typedef id (^ProtocolTrampoline_14)(void * sel, id arg1, id arg2, id * arg3); +typedef id (^_ProtocolTrampoline_14)(void * sel, id arg1, id arg2, id * arg3); __attribute__((visibility("default"))) __attribute__((used)) id _NativeCupertinoHttp_protocolTrampoline_10z9f5k(id target, void * sel, id arg1, id arg2, id * arg3) { - return ((ProtocolTrampoline_14)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); + return ((_ProtocolTrampoline_14)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } -typedef NSItemProviderRepresentationVisibility (^ProtocolTrampoline_15)(void * sel, id arg1); +typedef NSItemProviderRepresentationVisibility (^_ProtocolTrampoline_15)(void * sel, id arg1); __attribute__((visibility("default"))) __attribute__((used)) NSItemProviderRepresentationVisibility _NativeCupertinoHttp_protocolTrampoline_1ldqghh(id target, void * sel, id arg1) { - return ((ProtocolTrampoline_15)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); + return ((_ProtocolTrampoline_15)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef id (^ProtocolTrampoline_16)(void * sel, id arg1, id arg2); +typedef id (^_ProtocolTrampoline_16)(void * sel, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) id _NativeCupertinoHttp_protocolTrampoline_1q0i84(id target, void * sel, id arg1, id arg2) { - return ((ProtocolTrampoline_16)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); + return ((_ProtocolTrampoline_16)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); } -Protocol* _NativeCupertinoHttp_NSLocking(void) { return @protocol(NSLocking); } - -typedef void (^ListenerTrampoline_30)(void * arg0); +typedef void (^_ListenerTrampoline_30)(void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_30 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(ListenerTrampoline_30 block) NS_RETURNS_RETAINED { +_ListenerTrampoline_30 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(_ListenerTrampoline_30 block) NS_RETURNS_RETAINED { return ^void(void * arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^BlockingTrampoline_30)(void * waiter, void * arg0); +typedef void (^_BlockingTrampoline_30)(void * waiter, void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -ListenerTrampoline_30 _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( - BlockingTrampoline_30 block, BlockingTrampoline_30 listenerBlock, +_ListenerTrampoline_30 _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( + _BlockingTrampoline_30 block, _BlockingTrampoline_30 listenerBlock, DOBJC_Context* ctx) NS_RETURNS_RETAINED { BLOCKING_BLOCK_IMPL(ctx, ^void(void * arg0), { objc_retainBlock(block); @@ -888,10 +880,10 @@ ListenerTrampoline_30 _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( }); } -typedef void (^ProtocolTrampoline_17)(void * sel); +typedef void (^_ProtocolTrampoline_17)(void * sel); __attribute__((visibility("default"))) __attribute__((used)) void _NativeCupertinoHttp_protocolTrampoline_ovsamd(id target, void * sel) { - return ((ProtocolTrampoline_17)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); + return ((_ProtocolTrampoline_17)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); } #undef BLOCKING_BLOCK_IMPL diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index ad09dc6957..67b9c0ffd2 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -101,7 +101,7 @@ class URLCache extends _ObjectHolder { int diskCapacity = 0, Uri? directory, }) => URLCache._( - ncb.NSURLCache.alloc().initWithMemoryCapacity$1( + ncb.NSURLCache.alloc().initWithMemoryCapacity( memoryCapacity, diskCapacity: diskCapacity, directoryURL: directory == null ? null : _uriToNSURL(directory), @@ -139,7 +139,7 @@ class URLSessionConfiguration /// See [NSURLSessionConfiguration defaultSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411560-defaultsessionconfiguration) factory URLSessionConfiguration.defaultSessionConfiguration() => URLSessionConfiguration._( - ncb.NSURLSessionConfiguration.castFrom( + ncb.NSURLSessionConfiguration.as( ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration(), ), isBackground: false, @@ -151,7 +151,7 @@ class URLSessionConfiguration /// See [NSURLSessionConfiguration ephemeralSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1410529-ephemeralsessionconfiguration) factory URLSessionConfiguration.ephemeralSessionConfiguration() => URLSessionConfiguration._( - ncb.NSURLSessionConfiguration.castFrom( + ncb.NSURLSessionConfiguration.as( ncb.NSURLSessionConfiguration.getEphemeralSessionConfiguration(), ), isBackground: false, @@ -192,8 +192,8 @@ class URLSessionConfiguration /// Whether background tasks can be delayed by the system. /// /// See [NSURLSessionConfiguration.discretionary](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411552-discretionary) - bool get discretionary => _nsObject.discretionary; - set discretionary(bool value) => _nsObject.discretionary = value; + bool get discretionary => _nsObject.isDiscretionary; + set discretionary(bool value) => _nsObject.isDiscretionary = value; /// Additional headers to send with each request. /// @@ -202,7 +202,7 @@ class URLSessionConfiguration /// See [NSURLSessionConfiguration.HTTPAdditionalHeaders](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411532-httpadditionalheaders) Map? get httpAdditionalHeaders { if (_nsObject.HTTPAdditionalHeaders case var additionalHeaders?) { - final headers = objc.NSDictionary.castFrom(additionalHeaders); + final headers = objc.NSDictionary.as(additionalHeaders); return (objc.toDartObject(headers) as Map).cast(); } return null; @@ -337,8 +337,8 @@ class URLResponse extends _ObjectHolder { URLResponse._(super.c); factory URLResponse._exactURLResponseType(ncb.NSURLResponse response) { - if (ncb.NSHTTPURLResponse.isInstance(response)) { - return HTTPURLResponse._(ncb.NSHTTPURLResponse.castFrom(response)); + if (ncb.NSHTTPURLResponse.isA(response)) { + return HTTPURLResponse._(ncb.NSHTTPURLResponse.as(response)); } return URLResponse._(response); } @@ -778,7 +778,7 @@ class MutableURLRequest extends URLRequest { } set cachePolicy(NSURLRequestCachePolicy value) => - _mutableUrlRequest.cachePolicy = value; + _mutableUrlRequest.cachePolicy$1 = value; set httpBody(objc.NSData? data) { _mutableUrlRequest.HTTPBody = data; @@ -796,7 +796,7 @@ class MutableURLRequest extends URLRequest { } set timeoutInterval(Duration interval) { - _mutableUrlRequest.timeoutInterval = + _mutableUrlRequest.timeoutInterval$1 = interval.inMicroseconds.toDouble() / Duration.microsecondsPerSecond; } @@ -1115,7 +1115,7 @@ class URLSession extends _ObjectHolder { /// /// See [NSURLSession.configuration](https://developer.apple.com/documentation/foundation/nsurlsession/1411477-configuration) URLSessionConfiguration get configuration => URLSessionConfiguration._( - ncb.NSURLSessionConfiguration.castFrom(_nsObject.configuration), + ncb.NSURLSessionConfiguration.as(_nsObject.configuration), isBackground: _isBackground, ); @@ -1165,7 +1165,7 @@ class URLSession extends _ObjectHolder { final task = ncb.NSURLSessionAsynchronousConvenience( _nsObject, - ).dataTaskWithRequest(request._nsObject, completionHandler: completer); + ).dataTaskWithRequest$1(request._nsObject, completionHandler: completer); return URLSessionTask._(task); } diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index f994da5ccb..3fc0c43600 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -8,7 +8,7 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -// ignore_for_file: type=lint +// ignore_for_file: type=lint, unused_import import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; @@ -132,14 +132,13 @@ class NativeCupertinoHttp { late final _setrlimit = _setrlimitPtr .asFunction)>(); - int wait$1(ffi.Pointer arg0) { - return _wait$1(arg0); + int wait(ffi.Pointer arg0) { + return _wait(arg0); } - late final _wait$1Ptr = + late final _waitPtr = _lookup)>>('wait'); - late final _wait$1 = _wait$1Ptr - .asFunction)>(); + late final _wait = _waitPtr.asFunction)>(); int waitpid(int arg0, ffi.Pointer arg1, int arg2) { return _waitpid(arg0, arg1, arg2); @@ -2605,34 +2604,34 @@ class NativeCupertinoHttp { ffi.Pointer Function(ffi.Pointer) >(); - ffi.Pointer object_getClassName(objc.ObjCObjectBase? obj) { + ffi.Pointer object_getClassName(objc.ObjCObject? obj) { return _object_getClassName(obj?.ref.pointer ?? ffi.nullptr); } late final _object_getClassNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) > >('object_getClassName'); late final _object_getClassName = _object_getClassNamePtr .asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) >(); - ffi.Pointer object_getIndexedIvars(objc.ObjCObjectBase? obj) { + ffi.Pointer object_getIndexedIvars(objc.ObjCObject? obj) { return _object_getIndexedIvars(obj?.ref.pointer ?? ffi.nullptr); } late final _object_getIndexedIvarsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) > >('object_getIndexedIvars'); late final _object_getIndexedIvars = _object_getIndexedIvarsPtr .asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) >(); bool sel_isMapped(ffi.Pointer sel) { @@ -2661,10 +2660,10 @@ class NativeCupertinoHttp { ffi.Pointer Function(ffi.Pointer) >(); - objc.ObjCObjectBase? objc_retainedObject(objc_objectptr_t obj) { + objc.ObjCObject? objc_retainedObject(objc_objectptr_t obj) { return _objc_retainedObject(obj).address == 0 ? null - : objc.ObjCObjectBase( + : objc.ObjCObject( _objc_retainedObject(obj), retain: true, release: true, @@ -2674,16 +2673,18 @@ class NativeCupertinoHttp { late final _objc_retainedObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(objc_objectptr_t) + ffi.Pointer Function(objc_objectptr_t) > >('objc_retainedObject'); late final _objc_retainedObject = _objc_retainedObjectPtr - .asFunction Function(objc_objectptr_t)>(); + .asFunction< + ffi.Pointer Function(objc_objectptr_t) + >(); - objc.ObjCObjectBase? objc_unretainedObject(objc_objectptr_t obj) { + objc.ObjCObject? objc_unretainedObject(objc_objectptr_t obj) { return _objc_unretainedObject(obj).address == 0 ? null - : objc.ObjCObjectBase( + : objc.ObjCObject( _objc_unretainedObject(obj), retain: true, release: true, @@ -2693,24 +2694,28 @@ class NativeCupertinoHttp { late final _objc_unretainedObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(objc_objectptr_t) + ffi.Pointer Function(objc_objectptr_t) > >('objc_unretainedObject'); late final _objc_unretainedObject = _objc_unretainedObjectPtr - .asFunction Function(objc_objectptr_t)>(); + .asFunction< + ffi.Pointer Function(objc_objectptr_t) + >(); - objc_objectptr_t objc_unretainedPointer(objc.ObjCObjectBase? obj) { + objc_objectptr_t objc_unretainedPointer(objc.ObjCObject? obj) { return _objc_unretainedPointer(obj?.ref.pointer ?? ffi.nullptr); } late final _objc_unretainedPointerPtr = _lookup< ffi.NativeFunction< - objc_objectptr_t Function(ffi.Pointer) + objc_objectptr_t Function(ffi.Pointer) > >('objc_unretainedPointer'); late final _objc_unretainedPointer = _objc_unretainedPointerPtr - .asFunction)>(); + .asFunction< + objc_objectptr_t Function(ffi.Pointer) + >(); late final ffi.Pointer _NSFoundationVersionNumber = _lookup('NSFoundationVersionNumber'); @@ -2721,7 +2726,7 @@ class NativeCupertinoHttp { _NSFoundationVersionNumber.value = value; objc.NSString NSStringFromSelector(ffi.Pointer aSelector) { - return objc.NSString.castFromPointer( + return objc.NSString.fromPointer( _NSStringFromSelector(aSelector), retain: true, release: true, @@ -2731,12 +2736,16 @@ class NativeCupertinoHttp { late final _NSStringFromSelectorPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSStringFromSelector'); late final _NSStringFromSelector = _NSStringFromSelectorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); ffi.Pointer NSSelectorFromString( @@ -2748,16 +2757,20 @@ class NativeCupertinoHttp { late final _NSSelectorFromStringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSSelectorFromString'); late final _NSSelectorFromString = _NSSelectorFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); - objc.NSString NSStringFromClass(objc.ObjCObjectBase aClass) { - return objc.NSString.castFromPointer( + objc.NSString NSStringFromClass(objc.ObjCObject aClass) { + return objc.NSString.fromPointer( _NSStringFromClass(aClass.ref.pointer), retain: true, release: true, @@ -2767,18 +2780,22 @@ class NativeCupertinoHttp { late final _NSStringFromClassPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSStringFromClass'); late final _NSStringFromClass = _NSStringFromClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); - objc.ObjCObjectBase? NSClassFromString(objc.NSString aClassName) { + objc.ObjCObject? NSClassFromString(objc.NSString aClassName) { return _NSClassFromString(aClassName.ref.pointer).address == 0 ? null - : objc.ObjCObjectBase( + : objc.ObjCObject( _NSClassFromString(aClassName.ref.pointer), retain: true, release: true, @@ -2788,16 +2805,20 @@ class NativeCupertinoHttp { late final _NSClassFromStringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSClassFromString'); late final _NSClassFromString = _NSClassFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); objc.NSString NSStringFromProtocol(objc.Protocol proto) { - return objc.NSString.castFromPointer( + return objc.NSString.fromPointer( _NSStringFromProtocol(proto.ref.pointer), retain: true, release: true, @@ -2807,18 +2828,22 @@ class NativeCupertinoHttp { late final _NSStringFromProtocolPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSStringFromProtocol'); late final _NSStringFromProtocol = _NSStringFromProtocolPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); objc.Protocol? NSProtocolFromString(objc.NSString namestr) { return _NSProtocolFromString(namestr.ref.pointer).address == 0 ? null - : objc.Protocol.castFromPointer( + : objc.Protocol.fromPointer( _NSProtocolFromString(namestr.ref.pointer), retain: true, release: true, @@ -2828,12 +2853,16 @@ class NativeCupertinoHttp { late final _NSProtocolFromStringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) > >('NSProtocolFromString'); late final _NSProtocolFromString = _NSProtocolFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function( + ffi.Pointer, + ) >(); ffi.Pointer NSGetSizeAndAlignment( @@ -2869,10 +2898,10 @@ class NativeCupertinoHttp { late final _NSLogPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction)> >('NSLog'); late final _NSLog = - _NSLogPtr.asFunction)>(); + _NSLogPtr.asFunction)>(); void NSLogv(objc.NSString format, va_list args) { return _NSLogv(format.ref.pointer, args); @@ -2881,12 +2910,12 @@ class NativeCupertinoHttp { late final _NSLogvPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, va_list) + ffi.Void Function(ffi.Pointer, va_list) > >('NSLogv'); late final _NSLogv = _NSLogvPtr.asFunction< - void Function(ffi.Pointer, va_list) + void Function(ffi.Pointer, va_list) >(); late final ffi.Pointer _NSNotFound = _lookup( @@ -3138,6 +3167,24 @@ class NativeCupertinoHttp { CFAllocatorRef Function(CFAllocatorRef, ffi.Pointer) >(); + CFAllocatorRef CFAllocatorCreateWithZone( + CFAllocatorRef allocator, + ffi.Pointer<_malloc_zone_t> zone, + ) { + return _CFAllocatorCreateWithZone(allocator, zone); + } + + late final _CFAllocatorCreateWithZonePtr = + _lookup< + ffi.NativeFunction< + CFAllocatorRef Function(CFAllocatorRef, ffi.Pointer<_malloc_zone_t>) + > + >('CFAllocatorCreateWithZone'); + late final _CFAllocatorCreateWithZone = + _CFAllocatorCreateWithZonePtr.asFunction< + CFAllocatorRef Function(CFAllocatorRef, ffi.Pointer<_malloc_zone_t>) + >(); + ffi.Pointer CFAllocatorAllocateTyped( CFAllocatorRef allocator, int size, @@ -3514,16 +3561,19 @@ class NativeCupertinoHttp { late final _NSSetZoneNamePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer) + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) > >('NSSetZoneName'); late final _NSSetZoneName = _NSSetZoneNamePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer) + void Function(ffi.Pointer, ffi.Pointer) >(); objc.NSString NSZoneName(ffi.Pointer zone) { - return objc.NSString.castFromPointer( + return objc.NSString.fromPointer( _NSZoneName(zone), retain: true, release: true, @@ -3533,12 +3583,12 @@ class NativeCupertinoHttp { late final _NSZoneNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) > >('NSZoneName'); late final _NSZoneName = _NSZoneNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer) + ffi.Pointer Function(ffi.Pointer) >(); ffi.Pointer NSZoneFromPointer(ffi.Pointer ptr) { @@ -3770,12 +3820,12 @@ class NativeCupertinoHttp { late final _NSRealMemoryAvailable = _NSRealMemoryAvailablePtr.asFunction(); - objc.ObjCObjectBase NSAllocateObject( - objc.ObjCObjectBase aClass, + objc.ObjCObject NSAllocateObject( + objc.ObjCObject aClass, DartNSUInteger extraBytes, ffi.Pointer zone, ) { - return objc.ObjCObjectBase( + return objc.ObjCObject( _NSAllocateObject(aClass.ref.pointer, extraBytes, zone), retain: true, release: true, @@ -3785,8 +3835,8 @@ class NativeCupertinoHttp { late final _NSAllocateObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, NSUInteger, ffi.Pointer, ) @@ -3794,32 +3844,32 @@ class NativeCupertinoHttp { >('NSAllocateObject'); late final _NSAllocateObject = _NSAllocateObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer, ) >(); - void NSDeallocateObject(objc.ObjCObjectBase object) { + void NSDeallocateObject(objc.ObjCObject object) { return _NSDeallocateObject(object.ref.pointer); } late final _NSDeallocateObjectPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction)> >('NSDeallocateObject'); late final _NSDeallocateObject = _NSDeallocateObjectPtr.asFunction< - void Function(ffi.Pointer) + void Function(ffi.Pointer) >(); - objc.ObjCObjectBase NSCopyObject( - objc.ObjCObjectBase object, + objc.ObjCObject NSCopyObject( + objc.ObjCObject object, DartNSUInteger extraBytes, ffi.Pointer zone, ) { - return objc.ObjCObjectBase( + return objc.ObjCObject( _NSCopyObject(object.ref.pointer, extraBytes, zone), retain: true, release: true, @@ -3829,8 +3879,8 @@ class NativeCupertinoHttp { late final _NSCopyObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, NSUInteger, ffi.Pointer, ) @@ -3838,15 +3888,15 @@ class NativeCupertinoHttp { >('NSCopyObject'); late final _NSCopyObject = _NSCopyObjectPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer, ) >(); bool NSShouldRetainWithZone( - objc.ObjCObjectBase anObject, + objc.ObjCObject anObject, ffi.Pointer requestedZone, ) { return _NSShouldRetainWithZone(anObject.ref.pointer, requestedZone); @@ -3855,51 +3905,56 @@ class NativeCupertinoHttp { late final _NSShouldRetainWithZonePtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer) + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ) > >('NSShouldRetainWithZone'); late final _NSShouldRetainWithZone = _NSShouldRetainWithZonePtr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer) + bool Function(ffi.Pointer, ffi.Pointer) >(); - void NSIncrementExtraRefCount(objc.ObjCObjectBase object) { + void NSIncrementExtraRefCount(objc.ObjCObject object) { return _NSIncrementExtraRefCount(object.ref.pointer); } late final _NSIncrementExtraRefCountPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction)> >('NSIncrementExtraRefCount'); late final _NSIncrementExtraRefCount = _NSIncrementExtraRefCountPtr.asFunction< - void Function(ffi.Pointer) + void Function(ffi.Pointer) >(); - bool NSDecrementExtraRefCountWasZero(objc.ObjCObjectBase object) { + bool NSDecrementExtraRefCountWasZero(objc.ObjCObject object) { return _NSDecrementExtraRefCountWasZero(object.ref.pointer); } late final _NSDecrementExtraRefCountWasZeroPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction)> >('NSDecrementExtraRefCountWasZero'); late final _NSDecrementExtraRefCountWasZero = _NSDecrementExtraRefCountWasZeroPtr.asFunction< - bool Function(ffi.Pointer) + bool Function(ffi.Pointer) >(); - DartNSUInteger NSExtraRefCount(objc.ObjCObjectBase object) { + DartNSUInteger NSExtraRefCount(objc.ObjCObject object) { return _NSExtraRefCount(object.ref.pointer); } late final _NSExtraRefCountPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer) + > >('NSExtraRefCount'); late final _NSExtraRefCount = _NSExtraRefCountPtr.asFunction< - int Function(ffi.Pointer) + int Function(ffi.Pointer) >(); late final ffi.Pointer @@ -3908,14 +3963,14 @@ class NativeCupertinoHttp { ); DartNSNotificationName get NSSystemClockDidChangeNotification => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSSystemClockDidChangeNotification.value, retain: true, release: true, ); set NSSystemClockDidChangeNotification(DartNSNotificationName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSSystemClockDidChangeNotification.value, retain: false, release: true, @@ -3932,7 +3987,7 @@ class NativeCupertinoHttp { DartNSNotificationName get NSHTTPCookieManagerAcceptPolicyChangedNotification => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPCookieManagerAcceptPolicyChangedNotification.value, retain: true, release: true, @@ -3941,7 +3996,7 @@ class NativeCupertinoHttp { set NSHTTPCookieManagerAcceptPolicyChangedNotification( DartNSNotificationName value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPCookieManagerAcceptPolicyChangedNotification.value, retain: false, release: true, @@ -3956,7 +4011,7 @@ class NativeCupertinoHttp { ); DartNSNotificationName get NSHTTPCookieManagerCookiesChangedNotification => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPCookieManagerCookiesChangedNotification.value, retain: true, release: true, @@ -3965,7 +4020,7 @@ class NativeCupertinoHttp { set NSHTTPCookieManagerCookiesChangedNotification( DartNSNotificationName value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPCookieManagerCookiesChangedNotification.value, retain: false, release: true, @@ -3980,14 +4035,14 @@ class NativeCupertinoHttp { ); DartNSProgressUserInfoKey get NSProgressEstimatedTimeRemainingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressEstimatedTimeRemainingKey.value, retain: true, release: true, ); set NSProgressEstimatedTimeRemainingKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressEstimatedTimeRemainingKey.value, retain: false, release: true, @@ -4000,14 +4055,14 @@ class NativeCupertinoHttp { _lookup('NSProgressThroughputKey'); DartNSProgressUserInfoKey get NSProgressThroughputKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressThroughputKey.value, retain: true, release: true, ); set NSProgressThroughputKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressThroughputKey.value, retain: false, release: true, @@ -4018,14 +4073,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSProgressKindFile = _lookup('NSProgressKindFile'); - DartNSProgressKind get NSProgressKindFile => objc.NSString.castFromPointer( + DartNSProgressKind get NSProgressKindFile => objc.NSString.fromPointer( _NSProgressKindFile.value, retain: true, release: true, ); set NSProgressKindFile(DartNSProgressKind value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressKindFile.value, retain: false, release: true, @@ -4039,14 +4094,14 @@ class NativeCupertinoHttp { ); DartNSProgressUserInfoKey get NSProgressFileOperationKindKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindKey.value, retain: true, release: true, ); set NSProgressFileOperationKindKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindKey.value, retain: false, release: true, @@ -4061,7 +4116,7 @@ class NativeCupertinoHttp { ); DartNSProgressFileOperationKind get NSProgressFileOperationKindDownloading => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDownloading.value, retain: true, release: true, @@ -4070,7 +4125,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindDownloading( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDownloading.value, retain: false, release: true, @@ -4087,7 +4142,7 @@ class NativeCupertinoHttp { DartNSProgressFileOperationKind get NSProgressFileOperationKindDecompressingAfterDownloading => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDecompressingAfterDownloading.value, retain: true, release: true, @@ -4096,7 +4151,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindDecompressingAfterDownloading( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDecompressingAfterDownloading.value, retain: false, release: true, @@ -4111,7 +4166,7 @@ class NativeCupertinoHttp { ); DartNSProgressFileOperationKind get NSProgressFileOperationKindReceiving => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindReceiving.value, retain: true, release: true, @@ -4120,7 +4175,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindReceiving( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindReceiving.value, retain: false, release: true, @@ -4135,7 +4190,7 @@ class NativeCupertinoHttp { ); DartNSProgressFileOperationKind get NSProgressFileOperationKindCopying => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindCopying.value, retain: true, release: true, @@ -4144,7 +4199,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindCopying( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindCopying.value, retain: false, release: true, @@ -4159,7 +4214,7 @@ class NativeCupertinoHttp { ); DartNSProgressFileOperationKind get NSProgressFileOperationKindUploading => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindUploading.value, retain: true, release: true, @@ -4168,7 +4223,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindUploading( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindUploading.value, retain: false, release: true, @@ -4184,7 +4239,7 @@ class NativeCupertinoHttp { ); DartNSProgressFileOperationKind get NSProgressFileOperationKindDuplicating => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDuplicating.value, retain: true, release: true, @@ -4193,7 +4248,7 @@ class NativeCupertinoHttp { set NSProgressFileOperationKindDuplicating( DartNSProgressFileOperationKind value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileOperationKindDuplicating.value, retain: false, release: true, @@ -4206,14 +4261,14 @@ class NativeCupertinoHttp { _lookup('NSProgressFileURLKey'); DartNSProgressUserInfoKey get NSProgressFileURLKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileURLKey.value, retain: true, release: true, ); set NSProgressFileURLKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileURLKey.value, retain: false, release: true, @@ -4225,14 +4280,14 @@ class NativeCupertinoHttp { _lookup('NSProgressFileTotalCountKey'); DartNSProgressUserInfoKey get NSProgressFileTotalCountKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileTotalCountKey.value, retain: true, release: true, ); set NSProgressFileTotalCountKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileTotalCountKey.value, retain: false, release: true, @@ -4246,14 +4301,14 @@ class NativeCupertinoHttp { ); DartNSProgressUserInfoKey get NSProgressFileCompletedCountKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileCompletedCountKey.value, retain: true, release: true, ); set NSProgressFileCompletedCountKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileCompletedCountKey.value, retain: false, release: true, @@ -4267,14 +4322,14 @@ class NativeCupertinoHttp { ); DartNSProgressUserInfoKey get NSProgressFileAnimationImageKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileAnimationImageKey.value, retain: true, release: true, ); set NSProgressFileAnimationImageKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileAnimationImageKey.value, retain: false, release: true, @@ -4288,7 +4343,7 @@ class NativeCupertinoHttp { ); DartNSProgressUserInfoKey get NSProgressFileAnimationImageOriginalRectKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileAnimationImageOriginalRectKey.value, retain: true, release: true, @@ -4297,7 +4352,7 @@ class NativeCupertinoHttp { set NSProgressFileAnimationImageOriginalRectKey( DartNSProgressUserInfoKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileAnimationImageOriginalRectKey.value, retain: false, release: true, @@ -4310,14 +4365,14 @@ class NativeCupertinoHttp { _lookup('NSProgressFileIconKey'); DartNSProgressUserInfoKey get NSProgressFileIconKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileIconKey.value, retain: true, release: true, ); set NSProgressFileIconKey(DartNSProgressUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSProgressFileIconKey.value, retain: false, release: true, @@ -4989,15 +5044,6 @@ class NativeCupertinoHttp { _lookup>('freelocale'); late final _freelocale = _freelocalePtr.asFunction(); - ffi.Pointer localeconv() { - return _localeconv(); - } - - late final _localeconvPtr = - _lookup Function()>>('localeconv'); - late final _localeconv = _localeconvPtr - .asFunction Function()>(); - locale_t newlocale(int arg0, ffi.Pointer arg1, locale_t arg2) { return _newlocale(arg0, arg1, arg2); } @@ -5020,6 +5066,15 @@ class NativeCupertinoHttp { late final _uselocale = _uselocalePtr .asFunction(); + ffi.Pointer localeconv() { + return _localeconv(); + } + + late final _localeconvPtr = + _lookup Function()>>('localeconv'); + late final _localeconv = _localeconvPtr + .asFunction Function()>(); + ffi.Pointer setlocale(int arg0, ffi.Pointer arg1) { return _setlocale(arg0, arg1); } @@ -6402,27 +6457,27 @@ class NativeCupertinoHttp { int Function(int, ffi.Pointer, ffi.Pointer) >(); - int sigaction$1( + int sigaction( int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _sigaction$1(arg0, arg1, arg2); + return _sigaction(arg0, arg1, arg2); } - late final _sigaction$1Ptr = + late final _sigactionPtr = _lookup< ffi.NativeFunction< ffi.Int Function( ffi.Int, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >('sigaction'); - late final _sigaction$1 = _sigaction$1Ptr + late final _sigaction = _sigactionPtr .asFunction< - int Function(int, ffi.Pointer, ffi.Pointer) + int Function(int, ffi.Pointer, ffi.Pointer) >(); int sigaddset(ffi.Pointer arg0, int arg1) { @@ -6645,19 +6700,23 @@ class NativeCupertinoHttp { _lookup>('sigsetmask'); late final _sigsetmask = _sigsetmaskPtr.asFunction(); - int sigvec$1(int arg0, ffi.Pointer arg1, ffi.Pointer arg2) { - return _sigvec$1(arg0, arg1, arg2); + int sigvec(int arg0, ffi.Pointer arg1, ffi.Pointer arg2) { + return _sigvec(arg0, arg1, arg2); } - late final _sigvec$1Ptr = + late final _sigvecPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer) + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ) > >('sigvec'); - late final _sigvec$1 = _sigvec$1Ptr + late final _sigvec = _sigvecPtr .asFunction< - int Function(int, ffi.Pointer, ffi.Pointer) + int Function(int, ffi.Pointer, ffi.Pointer) >(); int renameat( @@ -8048,42 +8107,51 @@ class NativeCupertinoHttp { ) >(); - int __sprintf_chk( + int __snprintf_chk( ffi.Pointer arg0, - int arg1, + int __maxlen, int arg2, - ffi.Pointer arg3, + int arg3, + ffi.Pointer arg4, ) { - return ___sprintf_chk(arg0, arg1, arg2, arg3); + return ___snprintf_chk(arg0, __maxlen, arg2, arg3, arg4); } - late final ___sprintf_chkPtr = + late final ___snprintf_chkPtr = _lookup< ffi.NativeFunction< ffi.Int Function( ffi.Pointer, + ffi.Size, ffi.Int, ffi.Size, ffi.Pointer, ) > - >('__sprintf_chk'); - late final ___sprintf_chk = ___sprintf_chkPtr + >('__snprintf_chk'); + late final ___snprintf_chk = ___snprintf_chkPtr .asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer) + int Function( + ffi.Pointer, + int, + int, + int, + ffi.Pointer, + ) >(); - int __snprintf_chk( + int __vsnprintf_chk( ffi.Pointer arg0, int __maxlen, int arg2, int arg3, ffi.Pointer arg4, + va_list arg5, ) { - return ___snprintf_chk(arg0, __maxlen, arg2, arg3, arg4); + return ___vsnprintf_chk(arg0, __maxlen, arg2, arg3, arg4, arg5); } - late final ___snprintf_chkPtr = + late final ___vsnprintf_chkPtr = _lookup< ffi.NativeFunction< ffi.Int Function( @@ -8092,10 +8160,11 @@ class NativeCupertinoHttp { ffi.Int, ffi.Size, ffi.Pointer, + va_list, ) > - >('__snprintf_chk'); - late final ___snprintf_chk = ___snprintf_chkPtr + >('__vsnprintf_chk'); + late final ___vsnprintf_chk = ___vsnprintf_chkPtr .asFunction< int Function( ffi.Pointer, @@ -8103,20 +8172,20 @@ class NativeCupertinoHttp { int, int, ffi.Pointer, + va_list, ) >(); - int __vsprintf_chk( + int __sprintf_chk( ffi.Pointer arg0, int arg1, int arg2, ffi.Pointer arg3, - va_list arg4, ) { - return ___vsprintf_chk(arg0, arg1, arg2, arg3, arg4); + return ___sprintf_chk(arg0, arg1, arg2, arg3); } - late final ___vsprintf_chkPtr = + late final ___sprintf_chkPtr = _lookup< ffi.NativeFunction< ffi.Int Function( @@ -8124,52 +8193,42 @@ class NativeCupertinoHttp { ffi.Int, ffi.Size, ffi.Pointer, - va_list, ) > - >('__vsprintf_chk'); - late final ___vsprintf_chk = ___vsprintf_chkPtr + >('__sprintf_chk'); + late final ___sprintf_chk = ___sprintf_chkPtr .asFunction< - int Function( - ffi.Pointer, - int, - int, - ffi.Pointer, - va_list, - ) + int Function(ffi.Pointer, int, int, ffi.Pointer) >(); - int __vsnprintf_chk( + int __vsprintf_chk( ffi.Pointer arg0, - int __maxlen, + int arg1, int arg2, - int arg3, - ffi.Pointer arg4, - va_list arg5, + ffi.Pointer arg3, + va_list arg4, ) { - return ___vsnprintf_chk(arg0, __maxlen, arg2, arg3, arg4, arg5); + return ___vsprintf_chk(arg0, arg1, arg2, arg3, arg4); } - late final ___vsnprintf_chkPtr = + late final ___vsprintf_chkPtr = _lookup< ffi.NativeFunction< ffi.Int Function( ffi.Pointer, - ffi.Size, ffi.Int, ffi.Size, ffi.Pointer, va_list, ) > - >('__vsnprintf_chk'); - late final ___vsnprintf_chk = ___vsnprintf_chkPtr + >('__vsprintf_chk'); + late final ___vsprintf_chk = ___vsprintf_chkPtr .asFunction< int Function( ffi.Pointer, int, int, - int, ffi.Pointer, va_list, ) @@ -11759,6 +11818,62 @@ class NativeCupertinoHttp { CFCalendarIdentifier get kCFIslamicUmmAlQuraCalendar => _kCFIslamicUmmAlQuraCalendar.value; + late final ffi.Pointer _kCFBanglaCalendar = + _lookup('kCFBanglaCalendar'); + + CFCalendarIdentifier get kCFBanglaCalendar => _kCFBanglaCalendar.value; + + late final ffi.Pointer _kCFGujaratiCalendar = + _lookup('kCFGujaratiCalendar'); + + CFCalendarIdentifier get kCFGujaratiCalendar => _kCFGujaratiCalendar.value; + + late final ffi.Pointer _kCFKannadaCalendar = + _lookup('kCFKannadaCalendar'); + + CFCalendarIdentifier get kCFKannadaCalendar => _kCFKannadaCalendar.value; + + late final ffi.Pointer _kCFMalayalamCalendar = + _lookup('kCFMalayalamCalendar'); + + CFCalendarIdentifier get kCFMalayalamCalendar => _kCFMalayalamCalendar.value; + + late final ffi.Pointer _kCFMarathiCalendar = + _lookup('kCFMarathiCalendar'); + + CFCalendarIdentifier get kCFMarathiCalendar => _kCFMarathiCalendar.value; + + late final ffi.Pointer _kCFOdiaCalendar = + _lookup('kCFOdiaCalendar'); + + CFCalendarIdentifier get kCFOdiaCalendar => _kCFOdiaCalendar.value; + + late final ffi.Pointer _kCFTamilCalendar = + _lookup('kCFTamilCalendar'); + + CFCalendarIdentifier get kCFTamilCalendar => _kCFTamilCalendar.value; + + late final ffi.Pointer _kCFTeluguCalendar = + _lookup('kCFTeluguCalendar'); + + CFCalendarIdentifier get kCFTeluguCalendar => _kCFTeluguCalendar.value; + + late final ffi.Pointer _kCFVikramCalendar = + _lookup('kCFVikramCalendar'); + + CFCalendarIdentifier get kCFVikramCalendar => _kCFVikramCalendar.value; + + late final ffi.Pointer _kCFDangiCalendar = + _lookup('kCFDangiCalendar'); + + CFCalendarIdentifier get kCFDangiCalendar => _kCFDangiCalendar.value; + + late final ffi.Pointer _kCFVietnameseCalendar = + _lookup('kCFVietnameseCalendar'); + + CFCalendarIdentifier get kCFVietnameseCalendar => + _kCFVietnameseCalendar.value; + double CFAbsoluteTimeGetCurrent() { return _CFAbsoluteTimeGetCurrent(); } @@ -12235,9 +12350,9 @@ class NativeCupertinoHttp { CFDataRef theData, CFDataRef dataToFind, CFRange searchRange, - CFDataSearchFlags compareOptions, + int compareOptions, ) { - return _CFDataFind(theData, dataToFind, searchRange, compareOptions.value); + return _CFDataFind(theData, dataToFind, searchRange, compareOptions); } late final _CFDataFindPtr = @@ -13395,7 +13510,7 @@ class NativeCupertinoHttp { CFStringRef theString, int encoding, ) { - return _CFStringGetPascalStringPtr$1(theString, encoding); + return _CFStringGetPascalStringPtr(theString, encoding); } late final _CFStringGetPascalStringPtrPtr = @@ -13404,7 +13519,7 @@ class NativeCupertinoHttp { ConstStringPtr Function(CFStringRef, CFStringEncoding) > >('CFStringGetPascalStringPtr'); - late final _CFStringGetPascalStringPtr$1 = + late final _CFStringGetPascalStringPtr = _CFStringGetPascalStringPtrPtr.asFunction< ConstStringPtr Function(CFStringRef, int) >(); @@ -13413,7 +13528,7 @@ class NativeCupertinoHttp { CFStringRef theString, int encoding, ) { - return _CFStringGetCStringPtr$1(theString, encoding); + return _CFStringGetCStringPtr(theString, encoding); } late final _CFStringGetCStringPtrPtr = @@ -13422,20 +13537,20 @@ class NativeCupertinoHttp { ffi.Pointer Function(CFStringRef, CFStringEncoding) > >('CFStringGetCStringPtr'); - late final _CFStringGetCStringPtr$1 = + late final _CFStringGetCStringPtr = _CFStringGetCStringPtrPtr.asFunction< ffi.Pointer Function(CFStringRef, int) >(); ffi.Pointer CFStringGetCharactersPtr(CFStringRef theString) { - return _CFStringGetCharactersPtr$1(theString); + return _CFStringGetCharactersPtr(theString); } late final _CFStringGetCharactersPtrPtr = _lookup Function(CFStringRef)>>( 'CFStringGetCharactersPtr', ); - late final _CFStringGetCharactersPtr$1 = + late final _CFStringGetCharactersPtr = _CFStringGetCharactersPtrPtr.asFunction< ffi.Pointer Function(CFStringRef) >(); @@ -13640,7 +13755,7 @@ class NativeCupertinoHttp { CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, - CFStringCompareFlags compareOptions, + DartCFOptionFlags compareOptions, CFLocaleRef locale, ) { return CFComparisonResult.fromValue( @@ -13648,7 +13763,7 @@ class NativeCupertinoHttp { theString1, theString2, rangeToCompare, - compareOptions.value, + compareOptions, locale, ), ); @@ -13675,14 +13790,14 @@ class NativeCupertinoHttp { CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, - CFStringCompareFlags compareOptions, + DartCFOptionFlags compareOptions, ) { return CFComparisonResult.fromValue( _CFStringCompareWithOptions( theString1, theString2, rangeToCompare, - compareOptions.value, + compareOptions, ), ); } @@ -13701,10 +13816,10 @@ class NativeCupertinoHttp { CFComparisonResult CFStringCompare( CFStringRef theString1, CFStringRef theString2, - CFStringCompareFlags compareOptions, + DartCFOptionFlags compareOptions, ) { return CFComparisonResult.fromValue( - _CFStringCompare(theString1, theString2, compareOptions.value), + _CFStringCompare(theString1, theString2, compareOptions), ); } @@ -13719,11 +13834,11 @@ class NativeCupertinoHttp { int Function(CFStringRef, CFStringRef, int) >(); - DartBoolean CFStringFindWithOptionsAndLocale( + int CFStringFindWithOptionsAndLocale( CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, - CFStringCompareFlags searchOptions, + int searchOptions, CFLocaleRef locale, ffi.Pointer result, ) { @@ -13731,7 +13846,7 @@ class NativeCupertinoHttp { theString, stringToFind, rangeToSearch, - searchOptions.value, + searchOptions, locale, result, ); @@ -13762,18 +13877,18 @@ class NativeCupertinoHttp { ) >(); - DartBoolean CFStringFindWithOptions( + int CFStringFindWithOptions( CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, - CFStringCompareFlags searchOptions, + int searchOptions, ffi.Pointer result, ) { return _CFStringFindWithOptions( theString, stringToFind, rangeToSearch, - searchOptions.value, + searchOptions, result, ); } @@ -13806,14 +13921,14 @@ class NativeCupertinoHttp { CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, - CFStringCompareFlags compareOptions, + int compareOptions, ) { return _CFStringCreateArrayWithFindResults( alloc, theString, stringToFind, rangeToSearch, - compareOptions.value, + compareOptions, ); } @@ -13843,9 +13958,9 @@ class NativeCupertinoHttp { CFRange CFStringFind( CFStringRef theString, CFStringRef stringToFind, - CFStringCompareFlags compareOptions, + int compareOptions, ) { - return _CFStringFind(theString, stringToFind, compareOptions.value); + return _CFStringFind(theString, stringToFind, compareOptions); } late final _CFStringFindPtr = @@ -13901,18 +14016,18 @@ class NativeCupertinoHttp { CFRange Function(CFStringRef, int) >(); - DartBoolean CFStringFindCharacterFromSet( + int CFStringFindCharacterFromSet( CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, - CFStringCompareFlags searchOptions, + int searchOptions, ffi.Pointer result, ) { return _CFStringFindCharacterFromSet( theString, theSet, rangeToSearch, - searchOptions.value, + searchOptions, result, ); } @@ -14335,19 +14450,19 @@ class NativeCupertinoHttp { void Function(CFMutableStringRef, CFStringRef) >(); - DartCFIndex CFStringFindAndReplace( + int CFStringFindAndReplace( CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, - CFStringCompareFlags compareOptions, + int compareOptions, ) { return _CFStringFindAndReplace( theString, stringToFind, replacementString, rangeToSearch, - compareOptions.value, + compareOptions, ); } @@ -14501,10 +14616,10 @@ class NativeCupertinoHttp { void CFStringFold( CFMutableStringRef theString, - CFStringCompareFlags theFlags, + int theFlags, CFLocaleRef theLocale, ) { - return _CFStringFold(theString, theFlags.value, theLocale); + return _CFStringFold(theString, theFlags, theLocale); } late final _CFStringFoldPtr = @@ -15212,11 +15327,8 @@ class NativeCupertinoHttp { void Function(CFCalendarRef, int) >(); - CFRange CFCalendarGetMinimumRangeOfUnit( - CFCalendarRef calendar, - CFCalendarUnit unit, - ) { - return _CFCalendarGetMinimumRangeOfUnit(calendar, unit.value); + CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, int unit) { + return _CFCalendarGetMinimumRangeOfUnit(calendar, unit); } late final _CFCalendarGetMinimumRangeOfUnitPtr = @@ -15228,11 +15340,8 @@ class NativeCupertinoHttp { CFRange Function(CFCalendarRef, int) >(); - CFRange CFCalendarGetMaximumRangeOfUnit( - CFCalendarRef calendar, - CFCalendarUnit unit, - ) { - return _CFCalendarGetMaximumRangeOfUnit(calendar, unit.value); + CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, int unit) { + return _CFCalendarGetMaximumRangeOfUnit(calendar, unit); } late final _CFCalendarGetMaximumRangeOfUnitPtr = @@ -15246,16 +15355,11 @@ class NativeCupertinoHttp { CFRange CFCalendarGetRangeOfUnit( CFCalendarRef calendar, - CFCalendarUnit smallerUnit, - CFCalendarUnit biggerUnit, - DartCFTimeInterval at, + int smallerUnit, + int biggerUnit, + double at, ) { - return _CFCalendarGetRangeOfUnit( - calendar, - smallerUnit.value, - biggerUnit.value, - at, - ); + return _CFCalendarGetRangeOfUnit(calendar, smallerUnit, biggerUnit, at); } late final _CFCalendarGetRangeOfUnitPtr = @@ -15274,16 +15378,16 @@ class NativeCupertinoHttp { CFRange Function(CFCalendarRef, int, int, double) >(); - DartCFIndex CFCalendarGetOrdinalityOfUnit( + int CFCalendarGetOrdinalityOfUnit( CFCalendarRef calendar, - CFCalendarUnit smallerUnit, - CFCalendarUnit biggerUnit, - DartCFTimeInterval at, + int smallerUnit, + int biggerUnit, + double at, ) { return _CFCalendarGetOrdinalityOfUnit( calendar, - smallerUnit.value, - biggerUnit.value, + smallerUnit, + biggerUnit, at, ); } @@ -15304,14 +15408,14 @@ class NativeCupertinoHttp { int Function(CFCalendarRef, int, int, double) >(); - DartBoolean CFCalendarGetTimeRangeOfUnit( + int CFCalendarGetTimeRangeOfUnit( CFCalendarRef calendar, - CFCalendarUnit unit, - DartCFTimeInterval at, + int unit, + double at, ffi.Pointer startp, ffi.Pointer tip, ) { - return _CFCalendarGetTimeRangeOfUnit(calendar, unit.value, at, startp, tip); + return _CFCalendarGetTimeRangeOfUnit(calendar, unit, at, startp, tip); } late final _CFCalendarGetTimeRangeOfUnitPtr = @@ -15489,12 +15593,9 @@ class NativeCupertinoHttp { CFDateFormatterRef CFDateFormatterCreateISO8601Formatter( CFAllocatorRef allocator, - CFISO8601DateFormatOptions formatOptions, + int formatOptions, ) { - return _CFDateFormatterCreateISO8601Formatter( - allocator, - formatOptions.value, - ); + return _CFDateFormatterCreateISO8601Formatter(allocator, formatOptions); } late final _CFDateFormatterCreateISO8601FormatterPtr = @@ -17684,9 +17785,9 @@ class NativeCupertinoHttp { CFURLRef CFURLCreateCopyAppendingPathExtension( CFAllocatorRef allocator, CFURLRef url, - CFStringRef extension$, + CFStringRef extension, ) { - return _CFURLCreateCopyAppendingPathExtension(allocator, url, extension$); + return _CFURLCreateCopyAppendingPathExtension(allocator, url, extension); } late final _CFURLCreateCopyAppendingPathExtensionPtr = @@ -18867,10 +18968,24 @@ class NativeCupertinoHttp { CFStringRef get kCFURLUbiquitousItemDownloadingStatusCurrent => _kCFURLUbiquitousItemDownloadingStatusCurrent.value; + late final ffi.Pointer + _kCFURLUbiquitousItemSupportedSyncControlsKey = _lookup( + 'kCFURLUbiquitousItemSupportedSyncControlsKey', + ); + + CFStringRef get kCFURLUbiquitousItemSupportedSyncControlsKey => + _kCFURLUbiquitousItemSupportedSyncControlsKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemIsSyncPausedKey = + _lookup('kCFURLUbiquitousItemIsSyncPausedKey'); + + CFStringRef get kCFURLUbiquitousItemIsSyncPausedKey => + _kCFURLUbiquitousItemIsSyncPausedKey.value; + CFDataRef CFURLCreateBookmarkData( CFAllocatorRef allocator, CFURLRef url, - CFURLBookmarkCreationOptions options, + int options, CFArrayRef resourcePropertiesToInclude, CFURLRef relativeToURL, ffi.Pointer error, @@ -18878,7 +18993,7 @@ class NativeCupertinoHttp { return _CFURLCreateBookmarkData( allocator, url, - options.value, + options, resourcePropertiesToInclude, relativeToURL, error, @@ -18913,7 +19028,7 @@ class NativeCupertinoHttp { CFURLRef CFURLCreateByResolvingBookmarkData( CFAllocatorRef allocator, CFDataRef bookmark, - CFURLBookmarkResolutionOptions options, + int options, CFURLRef relativeToURL, CFArrayRef resourcePropertiesToInclude, ffi.Pointer isStale, @@ -18922,7 +19037,7 @@ class NativeCupertinoHttp { return _CFURLCreateByResolvingBookmarkData( allocator, bookmark, - options.value, + options, relativeToURL, resourcePropertiesToInclude, isStale, @@ -21622,14 +21737,14 @@ class NativeCupertinoHttp { _lookup>('setreuid'); late final _setreuid = _setreuidPtr.asFunction(); - void sync$() { - return _sync$(); + void sync() { + return _sync(); } - late final _sync$Ptr = _lookup>( + late final _syncPtr = _lookup>( 'sync', ); - late final _sync$ = _sync$Ptr.asFunction(); + late final _sync = _syncPtr.asFunction(); int truncate(ffi.Pointer arg0, int arg1) { return _truncate(arg0, arg1); @@ -23124,13 +23239,13 @@ class NativeCupertinoHttp { late final _openat_authenticated_np = _openat_authenticated_npPtr .asFunction, int, int)>(); - int flock$1(int arg0, int arg1) { - return _flock$1(arg0, arg1); + int flock(int arg0, int arg1) { + return _flock(arg0, arg1); } - late final _flock$1Ptr = + late final _flockPtr = _lookup>('flock'); - late final _flock$1 = _flock$1Ptr.asFunction(); + late final _flock = _flockPtr.asFunction(); filesec_t filesec_init() { return _filesec_init(); @@ -23243,7 +23358,7 @@ class NativeCupertinoHttp { ) { return _os_workgroup_create_with_port(name, mach_port).address == 0 ? null - : OS_os_workgroup.castFromPointer( + : OS_os_workgroup.fromPointer( _os_workgroup_create_with_port(name, mach_port), retain: false, release: true, @@ -23266,7 +23381,7 @@ class NativeCupertinoHttp { return _os_workgroup_create_with_workgroup(name, wg.ref.pointer).address == 0 ? null - : OS_os_workgroup.castFromPointer( + : OS_os_workgroup.fromPointer( _os_workgroup_create_with_workgroup(name, wg.ref.pointer), retain: false, release: true, @@ -23497,7 +23612,7 @@ class NativeCupertinoHttp { ) { return _os_workgroup_parallel_create(name, attr).address == 0 ? null - : OS_os_workgroup.castFromPointer( + : OS_os_workgroup.fromPointer( _os_workgroup_parallel_create(name, attr), retain: false, release: true, @@ -23986,7 +24101,7 @@ class NativeCupertinoHttp { >(); Dartdispatch_queue_t dispatch_get_current_queue() { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_get_current_queue(), retain: true, release: true, @@ -24009,7 +24124,7 @@ class NativeCupertinoHttp { int identifier, int flags, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_get_global_queue(identifier, flags), retain: true, release: true, @@ -24036,7 +24151,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_attr_t dispatch_queue_attr_make_initially_inactive( Dartdispatch_queue_attr_t? attr, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_queue_attr_make_initially_inactive( attr?.ref.pointer ?? ffi.nullptr, ), @@ -24059,7 +24174,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_attr_t? attr, dispatch_autorelease_frequency_t frequency, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_queue_attr_make_with_autorelease_frequency( attr?.ref.pointer ?? ffi.nullptr, frequency.value, @@ -24089,7 +24204,7 @@ class NativeCupertinoHttp { qos_class_t qos_class, int relative_priority, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_queue_attr_make_with_qos_class( attr?.ref.pointer ?? ffi.nullptr, qos_class.value, @@ -24121,7 +24236,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_attr_t? attr, Dartdispatch_queue_t? target, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_queue_create_with_target( label, attr?.ref.pointer ?? ffi.nullptr, @@ -24156,7 +24271,7 @@ class NativeCupertinoHttp { ffi.Pointer label, Dartdispatch_queue_attr_t? attr, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_queue_create(label, attr?.ref.pointer ?? ffi.nullptr), retain: false, release: true, @@ -24528,11 +24643,11 @@ class NativeCupertinoHttp { .asFunction(); Dartdispatch_block_t dispatch_block_create( - dispatch_block_flags_t flags, + int flags, Dartdispatch_block_t block, ) { - return ObjCBlock_ffiVoid.castFromPointer( - _dispatch_block_create(flags.value, block.ref.pointer), + return ObjCBlock_ffiVoid.fromPointer( + _dispatch_block_create(flags, block.ref.pointer), retain: false, release: true, ); @@ -24548,14 +24663,14 @@ class NativeCupertinoHttp { .asFunction(); Dartdispatch_block_t dispatch_block_create_with_qos_class( - dispatch_block_flags_t flags, + int flags, qos_class_t qos_class, int relative_priority, Dartdispatch_block_t block, ) { - return ObjCBlock_ffiVoid.castFromPointer( + return ObjCBlock_ffiVoid.fromPointer( _dispatch_block_create_with_qos_class( - flags.value, + flags, qos_class.value, relative_priority, block.ref.pointer, @@ -24582,11 +24697,8 @@ class NativeCupertinoHttp { dispatch_block_t Function(int, int, int, dispatch_block_t) >(); - void dispatch_block_perform( - dispatch_block_flags_t flags, - Dartdispatch_block_t block, - ) { - return _dispatch_block_perform(flags.value, block.ref.pointer); + void dispatch_block_perform(int flags, Dartdispatch_block_t block) { + return _dispatch_block_perform(flags, block.ref.pointer); } late final _dispatch_block_performPtr = @@ -24877,7 +24989,7 @@ class NativeCupertinoHttp { int mask, Dartdispatch_queue_t? queue, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_source_create( type, handle, @@ -25119,7 +25231,7 @@ class NativeCupertinoHttp { .asFunction(); Dartdispatch_group_t dispatch_group_create() { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_group_create(), retain: false, release: true, @@ -25296,7 +25408,7 @@ class NativeCupertinoHttp { .asFunction(); Dartdispatch_semaphore_t dispatch_semaphore_create(int value) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_semaphore_create(value), retain: false, release: true, @@ -25392,14 +25504,14 @@ class NativeCupertinoHttp { _lookup('_dispatch_data_destructor_free'); Dartdispatch_block_t get _dispatch_data_destructor_free => - ObjCBlock_ffiVoid.castFromPointer( + ObjCBlock_ffiVoid.fromPointer( __dispatch_data_destructor_free.value, retain: true, release: true, ); set _dispatch_data_destructor_free(Dartdispatch_block_t value) { - ObjCBlock_ffiVoid.castFromPointer( + ObjCBlock_ffiVoid.fromPointer( __dispatch_data_destructor_free.value, retain: false, release: true, @@ -25411,14 +25523,14 @@ class NativeCupertinoHttp { _lookup('_dispatch_data_destructor_munmap'); Dartdispatch_block_t get _dispatch_data_destructor_munmap => - ObjCBlock_ffiVoid.castFromPointer( + ObjCBlock_ffiVoid.fromPointer( __dispatch_data_destructor_munmap.value, retain: true, release: true, ); set _dispatch_data_destructor_munmap(Dartdispatch_block_t value) { - ObjCBlock_ffiVoid.castFromPointer( + ObjCBlock_ffiVoid.fromPointer( __dispatch_data_destructor_munmap.value, retain: false, release: true, @@ -25433,7 +25545,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_t? queue, Dartdispatch_block_t? destructor, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_data_create( buffer, size, @@ -25482,7 +25594,7 @@ class NativeCupertinoHttp { ffi.Pointer> buffer_ptr, ffi.Pointer size_ptr, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_data_create_map(data.ref.pointer, buffer_ptr, size_ptr), retain: false, release: true, @@ -25512,7 +25624,7 @@ class NativeCupertinoHttp { Dartdispatch_data_t data1, Dartdispatch_data_t data2, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_data_create_concat(data1.ref.pointer, data2.ref.pointer), retain: false, release: true, @@ -25533,7 +25645,7 @@ class NativeCupertinoHttp { int offset, int length, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_data_create_subrange(data.ref.pointer, offset, length), retain: false, release: true, @@ -25570,7 +25682,7 @@ class NativeCupertinoHttp { int location, ffi.Pointer offset_ptr, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_data_copy_region(data.ref.pointer, location, offset_ptr), retain: false, release: true, @@ -25663,7 +25775,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_t queue, objc.ObjCBlock cleanup_handler, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_io_create( type, fd, @@ -25704,7 +25816,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_t queue, objc.ObjCBlock cleanup_handler, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_io_create_with_path( type, path, @@ -25749,7 +25861,7 @@ class NativeCupertinoHttp { Dartdispatch_queue_t queue, objc.ObjCBlock cleanup_handler, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_io_create_with_io( type, io.ref.pointer, @@ -25947,7 +26059,7 @@ class NativeCupertinoHttp { Dartdispatch_workloop_t dispatch_workloop_create( ffi.Pointer label, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_workloop_create(label), retain: false, release: true, @@ -25964,7 +26076,7 @@ class NativeCupertinoHttp { Dartdispatch_workloop_t dispatch_workloop_create_inactive( ffi.Pointer label, ) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _dispatch_workloop_create_inactive(label), retain: false, release: true, @@ -26911,7 +27023,7 @@ class NativeCupertinoHttp { >(); Dartdispatch_queue_t CFReadStreamCopyDispatchQueue(CFReadStreamRef stream) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _CFReadStreamCopyDispatchQueue(stream), retain: true, release: true, @@ -26928,7 +27040,7 @@ class NativeCupertinoHttp { >(); Dartdispatch_queue_t CFWriteStreamCopyDispatchQueue(CFWriteStreamRef stream) { - return objc.NSObject.castFromPointer( + return objc.NSObject.fromPointer( _CFWriteStreamCopyDispatchQueue(stream), retain: true, release: true, @@ -30485,6 +30597,45 @@ class NativeCupertinoHttp { ) >(); + bool CFAttributedStringGetStatisticalWritingDirections( + CFAttributedStringRef attributedString, + CFRange range, + int baseDirection, + ffi.Pointer bidiLevels, + ffi.Pointer baseDirections, + ) { + return _CFAttributedStringGetStatisticalWritingDirections( + attributedString, + range, + baseDirection, + bidiLevels, + baseDirections, + ); + } + + late final _CFAttributedStringGetStatisticalWritingDirectionsPtr = + _lookup< + ffi.NativeFunction< + ffi.Bool Function( + CFAttributedStringRef, + CFRange, + ffi.Int8, + ffi.Pointer, + ffi.Pointer, + ) + > + >('CFAttributedStringGetStatisticalWritingDirections'); + late final _CFAttributedStringGetStatisticalWritingDirections = + _CFAttributedStringGetStatisticalWritingDirectionsPtr.asFunction< + bool Function( + CFAttributedStringRef, + CFRange, + int, + ffi.Pointer, + ffi.Pointer, + ) + >(); + int CFURLEnumeratorGetTypeID() { return _CFURLEnumeratorGetTypeID(); } @@ -30499,13 +30650,13 @@ class NativeCupertinoHttp { CFURLEnumeratorRef CFURLEnumeratorCreateForDirectoryURL( CFAllocatorRef alloc, CFURLRef directoryURL, - CFURLEnumeratorOptions option, + int option, CFArrayRef propertyKeys, ) { return _CFURLEnumeratorCreateForDirectoryURL( alloc, directoryURL, - option.value, + option, propertyKeys, ); } @@ -30528,14 +30679,10 @@ class NativeCupertinoHttp { CFURLEnumeratorRef CFURLEnumeratorCreateForMountedVolumes( CFAllocatorRef alloc, - CFURLEnumeratorOptions option, + int option, CFArrayRef propertyKeys, ) { - return _CFURLEnumeratorCreateForMountedVolumes( - alloc, - option.value, - propertyKeys, - ); + return _CFURLEnumeratorCreateForMountedVolumes(alloc, option, propertyKeys); } late final _CFURLEnumeratorCreateForMountedVolumesPtr = @@ -31446,11 +31593,11 @@ class NativeCupertinoHttp { int Function(CFFileSecurityRef, int) >(); - DartBoolean CFFileSecurityClearProperties( + int CFFileSecurityClearProperties( CFFileSecurityRef fileSec, - CFFileSecurityClearOptions clearPropertyMask, + int clearPropertyMask, ) { - return _CFFileSecurityClearProperties(fileSec, clearPropertyMask.value); + return _CFFileSecurityClearProperties(fileSec, clearPropertyMask); } late final _CFFileSecurityClearPropertiesPtr = @@ -31541,13 +31688,11 @@ class NativeCupertinoHttp { void Function(CFStringTokenizerRef, CFStringRef, CFRange) >(); - CFStringTokenizerTokenType CFStringTokenizerGoToTokenAtIndex( + int CFStringTokenizerGoToTokenAtIndex( CFStringTokenizerRef tokenizer, - DartCFIndex index, + int index$1, ) { - return CFStringTokenizerTokenType.fromValue( - _CFStringTokenizerGoToTokenAtIndex(tokenizer, index), - ); + return _CFStringTokenizerGoToTokenAtIndex(tokenizer, index$1); } late final _CFStringTokenizerGoToTokenAtIndexPtr = @@ -31561,12 +31706,8 @@ class NativeCupertinoHttp { int Function(CFStringTokenizerRef, int) >(); - CFStringTokenizerTokenType CFStringTokenizerAdvanceToNextToken( - CFStringTokenizerRef tokenizer, - ) { - return CFStringTokenizerTokenType.fromValue( - _CFStringTokenizerAdvanceToNextToken(tokenizer), - ); + int CFStringTokenizerAdvanceToNextToken(CFStringTokenizerRef tokenizer) { + return _CFStringTokenizerAdvanceToNextToken(tokenizer); } late final _CFStringTokenizerAdvanceToNextTokenPtr = @@ -32542,8 +32683,8 @@ class NativeCupertinoHttp { ffi.Pointer Function(CFXMLParserRef) >(); - CFXMLParserStatusCode CFXMLParserGetStatusCode(CFXMLParserRef parser) { - return CFXMLParserStatusCode.fromValue(_CFXMLParserGetStatusCode(parser)); + int CFXMLParserGetStatusCode(CFXMLParserRef parser) { + return _CFXMLParserGetStatusCode(parser); } late final _CFXMLParserGetStatusCodePtr = @@ -32568,10 +32709,10 @@ class NativeCupertinoHttp { void CFXMLParserAbort( CFXMLParserRef parser, - CFXMLParserStatusCode errorCode, + int errorCode, CFStringRef errorDescription, ) { - return _CFXMLParserAbort(parser, errorCode.value, errorDescription); + return _CFXMLParserAbort(parser, errorCode, errorDescription); } late final _CFXMLParserAbortPtr = @@ -33392,11 +33533,8 @@ class NativeCupertinoHttp { CFArrayRef Function(SecTrustRef) >(); - DartSInt32 SecTrustSetOptions( - SecTrustRef trustRef, - SecTrustOptionFlags options, - ) { - return _SecTrustSetOptions(trustRef, options.value); + int SecTrustSetOptions(SecTrustRef trustRef, int options) { + return _SecTrustSetOptions(trustRef, options); } late final _SecTrustSetOptionsPtr = @@ -34226,6 +34364,25 @@ class NativeCupertinoHttp { late final _SecIdentityGetTypeID = _SecIdentityGetTypeIDPtr.asFunction(); + SecIdentityRef SecIdentityCreate( + CFAllocatorRef allocator, + SecCertificateRef certificate, + SecKeyRef privateKey, + ) { + return _SecIdentityCreate(allocator, certificate, privateKey); + } + + late final _SecIdentityCreatePtr = + _lookup< + ffi.NativeFunction< + SecIdentityRef Function(CFAllocatorRef, SecCertificateRef, SecKeyRef) + > + >('SecIdentityCreate'); + late final _SecIdentityCreate = + _SecIdentityCreatePtr.asFunction< + SecIdentityRef Function(CFAllocatorRef, SecCertificateRef, SecKeyRef) + >(); + int SecIdentityCreateWithCertificate( CFTypeRef keychainOrArray, SecCertificateRef certificateRef, @@ -34431,7 +34588,7 @@ class NativeCupertinoHttp { Dartsec_trust_t? sec_trust_create(SecTrustRef trust) { return _sec_trust_create(trust).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_trust_create(trust), retain: false, release: true, @@ -34459,7 +34616,7 @@ class NativeCupertinoHttp { Dartsec_identity_t? sec_identity_create(SecIdentityRef identity) { return _sec_identity_create(identity).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_identity_create(identity), retain: false, release: true, @@ -34483,7 +34640,7 @@ class NativeCupertinoHttp { ).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_identity_create_with_certificates(identity, certificates), retain: false, release: true, @@ -34546,7 +34703,7 @@ class NativeCupertinoHttp { Dartsec_certificate_t? sec_certificate_create(SecCertificateRef certificate) { return _sec_certificate_create(certificate).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_certificate_create(certificate), retain: false, release: true, @@ -34591,6 +34748,26 @@ class NativeCupertinoHttp { ffi.Pointer Function(sec_protocol_metadata_t) >(); + ffi.Pointer sec_protocol_metadata_copy_negotiated_protocol( + Dartsec_protocol_metadata_t metadata, + ) { + return _sec_protocol_metadata_copy_negotiated_protocol( + metadata.ref.pointer, + ); + } + + late final _sec_protocol_metadata_copy_negotiated_protocolPtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer Function(sec_protocol_metadata_t) + > + >('sec_protocol_metadata_copy_negotiated_protocol'); + late final _sec_protocol_metadata_copy_negotiated_protocol = + _sec_protocol_metadata_copy_negotiated_protocolPtr + .asFunction< + ffi.Pointer Function(sec_protocol_metadata_t) + >(); + Dartdispatch_data_t? sec_protocol_metadata_copy_peer_public_key( Dartsec_protocol_metadata_t metadata, ) { @@ -34599,7 +34776,7 @@ class NativeCupertinoHttp { ).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_protocol_metadata_copy_peer_public_key(metadata.ref.pointer), retain: false, release: true, @@ -34857,6 +35034,24 @@ class NativeCupertinoHttp { ffi.Pointer Function(sec_protocol_metadata_t) >(); + ffi.Pointer sec_protocol_metadata_copy_server_name( + Dartsec_protocol_metadata_t metadata, + ) { + return _sec_protocol_metadata_copy_server_name(metadata.ref.pointer); + } + + late final _sec_protocol_metadata_copy_server_namePtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer Function(sec_protocol_metadata_t) + > + >('sec_protocol_metadata_copy_server_name'); + late final _sec_protocol_metadata_copy_server_name = + _sec_protocol_metadata_copy_server_namePtr + .asFunction< + ffi.Pointer Function(sec_protocol_metadata_t) + >(); + bool sec_protocol_metadata_peers_are_equal( Dartsec_protocol_metadata_t metadataA, Dartsec_protocol_metadata_t metadataB, @@ -34915,7 +35110,7 @@ class NativeCupertinoHttp { ).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_protocol_metadata_create_secret( metadata.ref.pointer, label_len, @@ -34967,7 +35162,7 @@ class NativeCupertinoHttp { ).address == 0 ? null - : objc.NSObject.castFromPointer( + : objc.NSObject.fromPointer( _sec_protocol_metadata_create_secret_with_context( metadata.ref.pointer, label_len, @@ -37136,20 +37331,21 @@ class NativeCupertinoHttp { _NSURLSessionTaskPriorityHigh.value; /// Key in the userInfo dictionary of an NSError received during a failed download. - late final ffi.Pointer> - _NSURLSessionDownloadTaskResumeData = _lookup>( - 'NSURLSessionDownloadTaskResumeData', - ); + late final ffi.Pointer> + _NSURLSessionDownloadTaskResumeData = + _lookup>( + 'NSURLSessionDownloadTaskResumeData', + ); objc.NSString get NSURLSessionDownloadTaskResumeData => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLSessionDownloadTaskResumeData.value, retain: true, release: true, ); set NSURLSessionDownloadTaskResumeData(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLSessionDownloadTaskResumeData.value, retain: false, release: true, @@ -37159,20 +37355,20 @@ class NativeCupertinoHttp { } /// Key in the userInfo dictionary of an NSError received during a failed upload. - late final ffi.Pointer> - _NSURLSessionUploadTaskResumeData = _lookup>( + late final ffi.Pointer> + _NSURLSessionUploadTaskResumeData = _lookup>( 'NSURLSessionUploadTaskResumeData', ); objc.NSString get NSURLSessionUploadTaskResumeData => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLSessionUploadTaskResumeData.value, retain: true, release: true, ); set NSURLSessionUploadTaskResumeData(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLSessionUploadTaskResumeData.value, retain: false, release: true, @@ -37204,7 +37400,7 @@ class NativeCupertinoHttp { _NSIntersectionRangePtr.asFunction(); objc.NSString NSStringFromRange(NSRange range) { - return objc.NSString.castFromPointer( + return objc.NSString.fromPointer( _NSStringFromRange(range), retain: true, release: true, @@ -37213,11 +37409,11 @@ class NativeCupertinoHttp { late final _NSStringFromRangePtr = _lookup< - ffi.NativeFunction Function(NSRange)> + ffi.NativeFunction Function(NSRange)> >('NSStringFromRange'); late final _NSStringFromRange = _NSStringFromRangePtr.asFunction< - ffi.Pointer Function(NSRange) + ffi.Pointer Function(NSRange) >(); NSRange NSRangeFromString(objc.NSString aString) { @@ -37226,27 +37422,28 @@ class NativeCupertinoHttp { late final _NSRangeFromStringPtr = _lookup< - ffi.NativeFunction)> + ffi.NativeFunction)> >('NSRangeFromString'); late final _NSRangeFromString = _NSRangeFromStringPtr.asFunction< - NSRange Function(ffi.Pointer) + NSRange Function(ffi.Pointer) >(); - late final ffi.Pointer> - _NSItemProviderPreferredImageSizeKey = _lookup>( - 'NSItemProviderPreferredImageSizeKey', - ); + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>( + 'NSItemProviderPreferredImageSizeKey', + ); objc.NSString get NSItemProviderPreferredImageSizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSItemProviderPreferredImageSizeKey.value, retain: true, release: true, ); set NSItemProviderPreferredImageSizeKey(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSItemProviderPreferredImageSizeKey.value, retain: false, release: true, @@ -37255,21 +37452,21 @@ class NativeCupertinoHttp { .retainAndReturnPointer(); } - late final ffi.Pointer> + late final ffi.Pointer> _NSExtensionJavaScriptPreprocessingResultsKey = - _lookup>( + _lookup>( 'NSExtensionJavaScriptPreprocessingResultsKey', ); objc.NSString get NSExtensionJavaScriptPreprocessingResultsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSExtensionJavaScriptPreprocessingResultsKey.value, retain: true, release: true, ); set NSExtensionJavaScriptPreprocessingResultsKey(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSExtensionJavaScriptPreprocessingResultsKey.value, retain: false, release: true, @@ -37278,21 +37475,21 @@ class NativeCupertinoHttp { .retainAndReturnPointer(); } - late final ffi.Pointer> + late final ffi.Pointer> _NSExtensionJavaScriptFinalizeArgumentKey = - _lookup>( + _lookup>( 'NSExtensionJavaScriptFinalizeArgumentKey', ); objc.NSString get NSExtensionJavaScriptFinalizeArgumentKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSExtensionJavaScriptFinalizeArgumentKey.value, retain: true, release: true, ); set NSExtensionJavaScriptFinalizeArgumentKey(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSExtensionJavaScriptFinalizeArgumentKey.value, retain: false, release: true, @@ -37301,19 +37498,19 @@ class NativeCupertinoHttp { .retainAndReturnPointer(); } - late final ffi.Pointer> - _NSItemProviderErrorDomain = _lookup>( + late final ffi.Pointer> + _NSItemProviderErrorDomain = _lookup>( 'NSItemProviderErrorDomain', ); - objc.NSString get NSItemProviderErrorDomain => objc.NSString.castFromPointer( + objc.NSString get NSItemProviderErrorDomain => objc.NSString.fromPointer( _NSItemProviderErrorDomain.value, retain: true, release: true, ); set NSItemProviderErrorDomain(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSItemProviderErrorDomain.value, retain: false, release: true, @@ -37325,14 +37522,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToKatakana'); DartNSStringTransform get NSStringTransformLatinToKatakana => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToKatakana.value, retain: true, release: true, ); set NSStringTransformLatinToKatakana(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToKatakana.value, retain: false, release: true, @@ -37345,14 +37542,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToHiragana'); DartNSStringTransform get NSStringTransformLatinToHiragana => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHiragana.value, retain: true, release: true, ); set NSStringTransformLatinToHiragana(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHiragana.value, retain: false, release: true, @@ -37365,14 +37562,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToHangul'); DartNSStringTransform get NSStringTransformLatinToHangul => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHangul.value, retain: true, release: true, ); set NSStringTransformLatinToHangul(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHangul.value, retain: false, release: true, @@ -37384,14 +37581,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToArabic'); DartNSStringTransform get NSStringTransformLatinToArabic => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToArabic.value, retain: true, release: true, ); set NSStringTransformLatinToArabic(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToArabic.value, retain: false, release: true, @@ -37403,14 +37600,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToHebrew'); DartNSStringTransform get NSStringTransformLatinToHebrew => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHebrew.value, retain: true, release: true, ); set NSStringTransformLatinToHebrew(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToHebrew.value, retain: false, release: true, @@ -37422,14 +37619,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToThai'); DartNSStringTransform get NSStringTransformLatinToThai => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToThai.value, retain: true, release: true, ); set NSStringTransformLatinToThai(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToThai.value, retain: false, release: true, @@ -37441,14 +37638,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToCyrillic'); DartNSStringTransform get NSStringTransformLatinToCyrillic => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToCyrillic.value, retain: true, release: true, ); set NSStringTransformLatinToCyrillic(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToCyrillic.value, retain: false, release: true, @@ -37461,14 +37658,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformLatinToGreek'); DartNSStringTransform get NSStringTransformLatinToGreek => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToGreek.value, retain: true, release: true, ); set NSStringTransformLatinToGreek(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformLatinToGreek.value, retain: false, release: true, @@ -37480,14 +37677,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformToLatin'); DartNSStringTransform get NSStringTransformToLatin => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToLatin.value, retain: true, release: true, ); set NSStringTransformToLatin(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToLatin.value, retain: false, release: true, @@ -37499,14 +37696,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformMandarinToLatin'); DartNSStringTransform get NSStringTransformMandarinToLatin => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformMandarinToLatin.value, retain: true, release: true, ); set NSStringTransformMandarinToLatin(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformMandarinToLatin.value, retain: false, release: true, @@ -37521,14 +37718,14 @@ class NativeCupertinoHttp { ); DartNSStringTransform get NSStringTransformHiraganaToKatakana => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformHiraganaToKatakana.value, retain: true, release: true, ); set NSStringTransformHiraganaToKatakana(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformHiraganaToKatakana.value, retain: false, release: true, @@ -37543,14 +37740,14 @@ class NativeCupertinoHttp { ); DartNSStringTransform get NSStringTransformFullwidthToHalfwidth => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformFullwidthToHalfwidth.value, retain: true, release: true, ); set NSStringTransformFullwidthToHalfwidth(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformFullwidthToHalfwidth.value, retain: false, release: true, @@ -37563,14 +37760,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformToXMLHex'); DartNSStringTransform get NSStringTransformToXMLHex => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToXMLHex.value, retain: true, release: true, ); set NSStringTransformToXMLHex(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToXMLHex.value, retain: false, release: true, @@ -37582,14 +37779,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformToUnicodeName'); DartNSStringTransform get NSStringTransformToUnicodeName => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToUnicodeName.value, retain: true, release: true, ); set NSStringTransformToUnicodeName(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformToUnicodeName.value, retain: false, release: true, @@ -37603,14 +37800,14 @@ class NativeCupertinoHttp { ); DartNSStringTransform get NSStringTransformStripCombiningMarks => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformStripCombiningMarks.value, retain: true, release: true, ); set NSStringTransformStripCombiningMarks(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformStripCombiningMarks.value, retain: false, release: true, @@ -37623,14 +37820,14 @@ class NativeCupertinoHttp { _lookup('NSStringTransformStripDiacritics'); DartNSStringTransform get NSStringTransformStripDiacritics => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformStripDiacritics.value, retain: true, release: true, ); set NSStringTransformStripDiacritics(DartNSStringTransform value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringTransformStripDiacritics.value, retain: false, release: true, @@ -37647,7 +37844,7 @@ class NativeCupertinoHttp { DartNSStringEncodingDetectionOptionsKey get NSStringEncodingDetectionSuggestedEncodingsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionSuggestedEncodingsKey.value, retain: true, release: true, @@ -37656,7 +37853,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionSuggestedEncodingsKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionSuggestedEncodingsKey.value, retain: false, release: true, @@ -37673,7 +37870,7 @@ class NativeCupertinoHttp { DartNSStringEncodingDetectionOptionsKey get NSStringEncodingDetectionDisallowedEncodingsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionDisallowedEncodingsKey.value, retain: true, release: true, @@ -37682,7 +37879,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionDisallowedEncodingsKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionDisallowedEncodingsKey.value, retain: false, release: true, @@ -37699,7 +37896,7 @@ class NativeCupertinoHttp { DartNSStringEncodingDetectionOptionsKey get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value, retain: true, release: true, @@ -37708,7 +37905,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value, retain: false, release: true, @@ -37724,7 +37921,7 @@ class NativeCupertinoHttp { ); DartNSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionAllowLossyKey => objc.NSString.castFromPointer( + get NSStringEncodingDetectionAllowLossyKey => objc.NSString.fromPointer( _NSStringEncodingDetectionAllowLossyKey.value, retain: true, release: true, @@ -37733,7 +37930,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionAllowLossyKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionAllowLossyKey.value, retain: false, release: true, @@ -37749,7 +37946,7 @@ class NativeCupertinoHttp { ); DartNSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionFromWindowsKey => objc.NSString.castFromPointer( + get NSStringEncodingDetectionFromWindowsKey => objc.NSString.fromPointer( _NSStringEncodingDetectionFromWindowsKey.value, retain: true, release: true, @@ -37758,7 +37955,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionFromWindowsKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionFromWindowsKey.value, retain: false, release: true, @@ -37775,7 +37972,7 @@ class NativeCupertinoHttp { DartNSStringEncodingDetectionOptionsKey get NSStringEncodingDetectionLossySubstitutionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionLossySubstitutionKey.value, retain: true, release: true, @@ -37784,7 +37981,7 @@ class NativeCupertinoHttp { set NSStringEncodingDetectionLossySubstitutionKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionLossySubstitutionKey.value, retain: false, release: true, @@ -37800,17 +37997,16 @@ class NativeCupertinoHttp { ); DartNSStringEncodingDetectionOptionsKey - get NSStringEncodingDetectionLikelyLanguageKey => - objc.NSString.castFromPointer( - _NSStringEncodingDetectionLikelyLanguageKey.value, - retain: true, - release: true, - ); + get NSStringEncodingDetectionLikelyLanguageKey => objc.NSString.fromPointer( + _NSStringEncodingDetectionLikelyLanguageKey.value, + retain: true, + release: true, + ); set NSStringEncodingDetectionLikelyLanguageKey( DartNSStringEncodingDetectionOptionsKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingDetectionLikelyLanguageKey.value, retain: false, release: true, @@ -37823,14 +38019,14 @@ class NativeCupertinoHttp { _lookup('NSCharacterConversionException'); DartNSExceptionName get NSCharacterConversionException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSCharacterConversionException.value, retain: true, release: true, ); set NSCharacterConversionException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSCharacterConversionException.value, retain: false, release: true, @@ -37841,15 +38037,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSParseErrorException = _lookup('NSParseErrorException'); - DartNSExceptionName get NSParseErrorException => - objc.NSString.castFromPointer( - _NSParseErrorException.value, - retain: true, - release: true, - ); + DartNSExceptionName get NSParseErrorException => objc.NSString.fromPointer( + _NSParseErrorException.value, + retain: true, + release: true, + ); set NSParseErrorException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSParseErrorException.value, retain: false, release: true, @@ -37857,144 +38052,145 @@ class NativeCupertinoHttp { _NSParseErrorException.value = value.ref.retainAndReturnPointer(); } - late final ffi.Pointer> - _NSHTTPPropertyStatusCodeKey = _lookup>( + late final ffi.Pointer> + _NSHTTPPropertyStatusCodeKey = _lookup>( 'NSHTTPPropertyStatusCodeKey', ); - objc.NSString get NSHTTPPropertyStatusCodeKey => - objc.NSString.castFromPointer( - _NSHTTPPropertyStatusCodeKey.value, - retain: true, - release: true, - ); + objc.NSString get NSHTTPPropertyStatusCodeKey => objc.NSString.fromPointer( + _NSHTTPPropertyStatusCodeKey.value, + retain: true, + release: true, + ); - late final ffi.Pointer> - _NSHTTPPropertyStatusReasonKey = _lookup>( + late final ffi.Pointer> + _NSHTTPPropertyStatusReasonKey = _lookup>( 'NSHTTPPropertyStatusReasonKey', ); - objc.NSString get NSHTTPPropertyStatusReasonKey => - objc.NSString.castFromPointer( - _NSHTTPPropertyStatusReasonKey.value, - retain: true, - release: true, - ); - - late final ffi.Pointer> - _NSHTTPPropertyServerHTTPVersionKey = _lookup>( - 'NSHTTPPropertyServerHTTPVersionKey', + objc.NSString get NSHTTPPropertyStatusReasonKey => objc.NSString.fromPointer( + _NSHTTPPropertyStatusReasonKey.value, + retain: true, + release: true, ); + late final ffi.Pointer> + _NSHTTPPropertyServerHTTPVersionKey = + _lookup>( + 'NSHTTPPropertyServerHTTPVersionKey', + ); + objc.NSString get NSHTTPPropertyServerHTTPVersionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPPropertyServerHTTPVersionKey.value, retain: true, release: true, ); - late final ffi.Pointer> - _NSHTTPPropertyRedirectionHeadersKey = _lookup>( - 'NSHTTPPropertyRedirectionHeadersKey', - ); + late final ffi.Pointer> + _NSHTTPPropertyRedirectionHeadersKey = + _lookup>( + 'NSHTTPPropertyRedirectionHeadersKey', + ); objc.NSString get NSHTTPPropertyRedirectionHeadersKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHTTPPropertyRedirectionHeadersKey.value, retain: true, release: true, ); - late final ffi.Pointer> - _NSHTTPPropertyErrorPageDataKey = _lookup>( + late final ffi.Pointer> + _NSHTTPPropertyErrorPageDataKey = _lookup>( 'NSHTTPPropertyErrorPageDataKey', ); - objc.NSString get NSHTTPPropertyErrorPageDataKey => - objc.NSString.castFromPointer( - _NSHTTPPropertyErrorPageDataKey.value, - retain: true, - release: true, - ); + objc.NSString get NSHTTPPropertyErrorPageDataKey => objc.NSString.fromPointer( + _NSHTTPPropertyErrorPageDataKey.value, + retain: true, + release: true, + ); - late final ffi.Pointer> - _NSHTTPPropertyHTTPProxy = _lookup>( + late final ffi.Pointer> + _NSHTTPPropertyHTTPProxy = _lookup>( 'NSHTTPPropertyHTTPProxy', ); - objc.NSString get NSHTTPPropertyHTTPProxy => objc.NSString.castFromPointer( + objc.NSString get NSHTTPPropertyHTTPProxy => objc.NSString.fromPointer( _NSHTTPPropertyHTTPProxy.value, retain: true, release: true, ); - late final ffi.Pointer> - _NSFTPPropertyUserLoginKey = _lookup>( + late final ffi.Pointer> + _NSFTPPropertyUserLoginKey = _lookup>( 'NSFTPPropertyUserLoginKey', ); - objc.NSString get NSFTPPropertyUserLoginKey => objc.NSString.castFromPointer( + objc.NSString get NSFTPPropertyUserLoginKey => objc.NSString.fromPointer( _NSFTPPropertyUserLoginKey.value, retain: true, release: true, ); - late final ffi.Pointer> - _NSFTPPropertyUserPasswordKey = _lookup>( + late final ffi.Pointer> + _NSFTPPropertyUserPasswordKey = _lookup>( 'NSFTPPropertyUserPasswordKey', ); - objc.NSString get NSFTPPropertyUserPasswordKey => - objc.NSString.castFromPointer( - _NSFTPPropertyUserPasswordKey.value, - retain: true, - release: true, - ); - - late final ffi.Pointer> - _NSFTPPropertyActiveTransferModeKey = _lookup>( - 'NSFTPPropertyActiveTransferModeKey', + objc.NSString get NSFTPPropertyUserPasswordKey => objc.NSString.fromPointer( + _NSFTPPropertyUserPasswordKey.value, + retain: true, + release: true, ); + late final ffi.Pointer> + _NSFTPPropertyActiveTransferModeKey = + _lookup>( + 'NSFTPPropertyActiveTransferModeKey', + ); + objc.NSString get NSFTPPropertyActiveTransferModeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSFTPPropertyActiveTransferModeKey.value, retain: true, release: true, ); - late final ffi.Pointer> - _NSFTPPropertyFileOffsetKey = _lookup>( + late final ffi.Pointer> + _NSFTPPropertyFileOffsetKey = _lookup>( 'NSFTPPropertyFileOffsetKey', ); - objc.NSString get NSFTPPropertyFileOffsetKey => objc.NSString.castFromPointer( + objc.NSString get NSFTPPropertyFileOffsetKey => objc.NSString.fromPointer( _NSFTPPropertyFileOffsetKey.value, retain: true, release: true, ); - late final ffi.Pointer> _NSFTPPropertyFTPProxy = - _lookup>('NSFTPPropertyFTPProxy'); + late final ffi.Pointer> + _NSFTPPropertyFTPProxy = _lookup>( + 'NSFTPPropertyFTPProxy', + ); - objc.NSString get NSFTPPropertyFTPProxy => objc.NSString.castFromPointer( + objc.NSString get NSFTPPropertyFTPProxy => objc.NSString.fromPointer( _NSFTPPropertyFTPProxy.value, retain: true, release: true, ); /// A string constant for the "file" URL scheme. If you are using this to compare to a URL's scheme to see if it is a file URL, you should instead use the NSURL fileURL property -- the fileURL property is much faster. - late final ffi.Pointer> _NSURLFileScheme = - _lookup>('NSURLFileScheme'); + late final ffi.Pointer> _NSURLFileScheme = + _lookup>('NSURLFileScheme'); - objc.NSString get NSURLFileScheme => objc.NSString.castFromPointer( + objc.NSString get NSURLFileScheme => objc.NSString.fromPointer( _NSURLFileScheme.value, retain: true, release: true, ); set NSURLFileScheme(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileScheme.value, retain: false, release: true, @@ -38007,14 +38203,14 @@ class NativeCupertinoHttp { _lookup('NSURLKeysOfUnsetValuesKey'); DartNSURLResourceKey get NSURLKeysOfUnsetValuesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLKeysOfUnsetValuesKey.value, retain: true, release: true, ); set NSURLKeysOfUnsetValuesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLKeysOfUnsetValuesKey.value, retain: false, release: true, @@ -38026,14 +38222,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLNameKey = _lookup('NSURLNameKey'); - DartNSURLResourceKey get NSURLNameKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLNameKey => objc.NSString.fromPointer( _NSURLNameKey.value, retain: true, release: true, ); set NSURLNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLNameKey.value, retain: false, release: true, @@ -38045,15 +38241,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLLocalizedNameKey = _lookup('NSURLLocalizedNameKey'); - DartNSURLResourceKey get NSURLLocalizedNameKey => - objc.NSString.castFromPointer( - _NSURLLocalizedNameKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLLocalizedNameKey => objc.NSString.fromPointer( + _NSURLLocalizedNameKey.value, + retain: true, + release: true, + ); set NSURLLocalizedNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLocalizedNameKey.value, retain: false, release: true, @@ -38065,15 +38260,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsRegularFileKey = _lookup('NSURLIsRegularFileKey'); - DartNSURLResourceKey get NSURLIsRegularFileKey => - objc.NSString.castFromPointer( - _NSURLIsRegularFileKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsRegularFileKey => objc.NSString.fromPointer( + _NSURLIsRegularFileKey.value, + retain: true, + release: true, + ); set NSURLIsRegularFileKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsRegularFileKey.value, retain: false, release: true, @@ -38085,14 +38279,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsDirectoryKey = _lookup('NSURLIsDirectoryKey'); - DartNSURLResourceKey get NSURLIsDirectoryKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsDirectoryKey => objc.NSString.fromPointer( _NSURLIsDirectoryKey.value, retain: true, release: true, ); set NSURLIsDirectoryKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsDirectoryKey.value, retain: false, release: true, @@ -38104,15 +38298,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsSymbolicLinkKey = _lookup('NSURLIsSymbolicLinkKey'); - DartNSURLResourceKey get NSURLIsSymbolicLinkKey => - objc.NSString.castFromPointer( - _NSURLIsSymbolicLinkKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsSymbolicLinkKey => objc.NSString.fromPointer( + _NSURLIsSymbolicLinkKey.value, + retain: true, + release: true, + ); set NSURLIsSymbolicLinkKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsSymbolicLinkKey.value, retain: false, release: true, @@ -38124,14 +38317,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsVolumeKey = _lookup('NSURLIsVolumeKey'); - DartNSURLResourceKey get NSURLIsVolumeKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsVolumeKey => objc.NSString.fromPointer( _NSURLIsVolumeKey.value, retain: true, release: true, ); set NSURLIsVolumeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsVolumeKey.value, retain: false, release: true, @@ -38143,14 +38336,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsPackageKey = _lookup('NSURLIsPackageKey'); - DartNSURLResourceKey get NSURLIsPackageKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsPackageKey => objc.NSString.fromPointer( _NSURLIsPackageKey.value, retain: true, release: true, ); set NSURLIsPackageKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsPackageKey.value, retain: false, release: true, @@ -38162,15 +38355,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsApplicationKey = _lookup('NSURLIsApplicationKey'); - DartNSURLResourceKey get NSURLIsApplicationKey => - objc.NSString.castFromPointer( - _NSURLIsApplicationKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsApplicationKey => objc.NSString.fromPointer( + _NSURLIsApplicationKey.value, + retain: true, + release: true, + ); set NSURLIsApplicationKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsApplicationKey.value, retain: false, release: true, @@ -38183,14 +38375,14 @@ class NativeCupertinoHttp { _lookup('NSURLApplicationIsScriptableKey'); DartNSURLResourceKey get NSURLApplicationIsScriptableKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLApplicationIsScriptableKey.value, retain: true, release: true, ); set NSURLApplicationIsScriptableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLApplicationIsScriptableKey.value, retain: false, release: true, @@ -38203,14 +38395,14 @@ class NativeCupertinoHttp { _lookup('NSURLIsSystemImmutableKey'); DartNSURLResourceKey get NSURLIsSystemImmutableKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsSystemImmutableKey.value, retain: true, release: true, ); set NSURLIsSystemImmutableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsSystemImmutableKey.value, retain: false, release: true, @@ -38222,15 +38414,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsUserImmutableKey = _lookup('NSURLIsUserImmutableKey'); - DartNSURLResourceKey get NSURLIsUserImmutableKey => - objc.NSString.castFromPointer( - _NSURLIsUserImmutableKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsUserImmutableKey => objc.NSString.fromPointer( + _NSURLIsUserImmutableKey.value, + retain: true, + release: true, + ); set NSURLIsUserImmutableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsUserImmutableKey.value, retain: false, release: true, @@ -38242,14 +38433,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsHiddenKey = _lookup('NSURLIsHiddenKey'); - DartNSURLResourceKey get NSURLIsHiddenKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsHiddenKey => objc.NSString.fromPointer( _NSURLIsHiddenKey.value, retain: true, release: true, ); set NSURLIsHiddenKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsHiddenKey.value, retain: false, release: true, @@ -38262,14 +38453,14 @@ class NativeCupertinoHttp { _lookup('NSURLHasHiddenExtensionKey'); DartNSURLResourceKey get NSURLHasHiddenExtensionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLHasHiddenExtensionKey.value, retain: true, release: true, ); set NSURLHasHiddenExtensionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLHasHiddenExtensionKey.value, retain: false, release: true, @@ -38281,15 +38472,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLCreationDateKey = _lookup('NSURLCreationDateKey'); - DartNSURLResourceKey get NSURLCreationDateKey => - objc.NSString.castFromPointer( - _NSURLCreationDateKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLCreationDateKey => objc.NSString.fromPointer( + _NSURLCreationDateKey.value, + retain: true, + release: true, + ); set NSURLCreationDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLCreationDateKey.value, retain: false, release: true, @@ -38302,14 +38492,14 @@ class NativeCupertinoHttp { _lookup('NSURLContentAccessDateKey'); DartNSURLResourceKey get NSURLContentAccessDateKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLContentAccessDateKey.value, retain: true, release: true, ); set NSURLContentAccessDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLContentAccessDateKey.value, retain: false, release: true, @@ -38322,14 +38512,14 @@ class NativeCupertinoHttp { _lookup('NSURLContentModificationDateKey'); DartNSURLResourceKey get NSURLContentModificationDateKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLContentModificationDateKey.value, retain: true, release: true, ); set NSURLContentModificationDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLContentModificationDateKey.value, retain: false, release: true, @@ -38342,14 +38532,14 @@ class NativeCupertinoHttp { _lookup('NSURLAttributeModificationDateKey'); DartNSURLResourceKey get NSURLAttributeModificationDateKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLAttributeModificationDateKey.value, retain: true, release: true, ); set NSURLAttributeModificationDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLAttributeModificationDateKey.value, retain: false, release: true, @@ -38362,14 +38552,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLLinkCountKey = _lookup('NSURLLinkCountKey'); - DartNSURLResourceKey get NSURLLinkCountKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLLinkCountKey => objc.NSString.fromPointer( _NSURLLinkCountKey.value, retain: true, release: true, ); set NSURLLinkCountKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLinkCountKey.value, retain: false, release: true, @@ -38382,14 +38572,14 @@ class NativeCupertinoHttp { _lookup('NSURLParentDirectoryURLKey'); DartNSURLResourceKey get NSURLParentDirectoryURLKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLParentDirectoryURLKey.value, retain: true, release: true, ); set NSURLParentDirectoryURLKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLParentDirectoryURLKey.value, retain: false, release: true, @@ -38401,14 +38591,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLVolumeURLKey = _lookup('NSURLVolumeURLKey'); - DartNSURLResourceKey get NSURLVolumeURLKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLVolumeURLKey => objc.NSString.fromPointer( _NSURLVolumeURLKey.value, retain: true, release: true, ); set NSURLVolumeURLKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeURLKey.value, retain: false, release: true, @@ -38420,15 +38610,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLTypeIdentifierKey = _lookup('NSURLTypeIdentifierKey'); - DartNSURLResourceKey get NSURLTypeIdentifierKey => - objc.NSString.castFromPointer( - _NSURLTypeIdentifierKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLTypeIdentifierKey => objc.NSString.fromPointer( + _NSURLTypeIdentifierKey.value, + retain: true, + release: true, + ); set NSURLTypeIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLTypeIdentifierKey.value, retain: false, release: true, @@ -38440,14 +38629,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLContentTypeKey = _lookup('NSURLContentTypeKey'); - DartNSURLResourceKey get NSURLContentTypeKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLContentTypeKey => objc.NSString.fromPointer( _NSURLContentTypeKey.value, retain: true, release: true, ); set NSURLContentTypeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLContentTypeKey.value, retain: false, release: true, @@ -38460,14 +38649,14 @@ class NativeCupertinoHttp { _lookup('NSURLLocalizedTypeDescriptionKey'); DartNSURLResourceKey get NSURLLocalizedTypeDescriptionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLocalizedTypeDescriptionKey.value, retain: true, release: true, ); set NSURLLocalizedTypeDescriptionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLocalizedTypeDescriptionKey.value, retain: false, release: true, @@ -38480,14 +38669,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLLabelNumberKey = _lookup('NSURLLabelNumberKey'); - DartNSURLResourceKey get NSURLLabelNumberKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLLabelNumberKey => objc.NSString.fromPointer( _NSURLLabelNumberKey.value, retain: true, release: true, ); set NSURLLabelNumberKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLabelNumberKey.value, retain: false, release: true, @@ -38499,14 +38688,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLLabelColorKey = _lookup('NSURLLabelColorKey'); - DartNSURLResourceKey get NSURLLabelColorKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLLabelColorKey => objc.NSString.fromPointer( _NSURLLabelColorKey.value, retain: true, release: true, ); set NSURLLabelColorKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLabelColorKey.value, retain: false, release: true, @@ -38518,15 +38707,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLLocalizedLabelKey = _lookup('NSURLLocalizedLabelKey'); - DartNSURLResourceKey get NSURLLocalizedLabelKey => - objc.NSString.castFromPointer( - _NSURLLocalizedLabelKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLLocalizedLabelKey => objc.NSString.fromPointer( + _NSURLLocalizedLabelKey.value, + retain: true, + release: true, + ); set NSURLLocalizedLabelKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLLocalizedLabelKey.value, retain: false, release: true, @@ -38538,15 +38726,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLEffectiveIconKey = _lookup('NSURLEffectiveIconKey'); - DartNSURLResourceKey get NSURLEffectiveIconKey => - objc.NSString.castFromPointer( - _NSURLEffectiveIconKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLEffectiveIconKey => objc.NSString.fromPointer( + _NSURLEffectiveIconKey.value, + retain: true, + release: true, + ); set NSURLEffectiveIconKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLEffectiveIconKey.value, retain: false, release: true, @@ -38558,14 +38745,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLCustomIconKey = _lookup('NSURLCustomIconKey'); - DartNSURLResourceKey get NSURLCustomIconKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLCustomIconKey => objc.NSString.fromPointer( _NSURLCustomIconKey.value, retain: true, release: true, ); set NSURLCustomIconKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLCustomIconKey.value, retain: false, release: true, @@ -38578,14 +38765,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileResourceIdentifierKey'); DartNSURLResourceKey get NSURLFileResourceIdentifierKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceIdentifierKey.value, retain: true, release: true, ); set NSURLFileResourceIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceIdentifierKey.value, retain: false, release: true, @@ -38598,14 +38785,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIdentifierKey'); DartNSURLResourceKey get NSURLVolumeIdentifierKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIdentifierKey.value, retain: true, release: true, ); set NSURLVolumeIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIdentifierKey.value, retain: false, release: true, @@ -38618,14 +38805,14 @@ class NativeCupertinoHttp { _lookup('NSURLPreferredIOBlockSizeKey'); DartNSURLResourceKey get NSURLPreferredIOBlockSizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLPreferredIOBlockSizeKey.value, retain: true, release: true, ); set NSURLPreferredIOBlockSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLPreferredIOBlockSizeKey.value, retain: false, release: true, @@ -38637,14 +38824,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsReadableKey = _lookup('NSURLIsReadableKey'); - DartNSURLResourceKey get NSURLIsReadableKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsReadableKey => objc.NSString.fromPointer( _NSURLIsReadableKey.value, retain: true, release: true, ); set NSURLIsReadableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsReadableKey.value, retain: false, release: true, @@ -38656,14 +38843,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsWritableKey = _lookup('NSURLIsWritableKey'); - DartNSURLResourceKey get NSURLIsWritableKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsWritableKey => objc.NSString.fromPointer( _NSURLIsWritableKey.value, retain: true, release: true, ); set NSURLIsWritableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsWritableKey.value, retain: false, release: true, @@ -38675,15 +38862,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsExecutableKey = _lookup('NSURLIsExecutableKey'); - DartNSURLResourceKey get NSURLIsExecutableKey => - objc.NSString.castFromPointer( - _NSURLIsExecutableKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsExecutableKey => objc.NSString.fromPointer( + _NSURLIsExecutableKey.value, + retain: true, + release: true, + ); set NSURLIsExecutableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsExecutableKey.value, retain: false, release: true, @@ -38695,15 +38881,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLFileSecurityKey = _lookup('NSURLFileSecurityKey'); - DartNSURLResourceKey get NSURLFileSecurityKey => - objc.NSString.castFromPointer( - _NSURLFileSecurityKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLFileSecurityKey => objc.NSString.fromPointer( + _NSURLFileSecurityKey.value, + retain: true, + release: true, + ); set NSURLFileSecurityKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileSecurityKey.value, retain: false, release: true, @@ -38716,14 +38901,14 @@ class NativeCupertinoHttp { _lookup('NSURLIsExcludedFromBackupKey'); DartNSURLResourceKey get NSURLIsExcludedFromBackupKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsExcludedFromBackupKey.value, retain: true, release: true, ); set NSURLIsExcludedFromBackupKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsExcludedFromBackupKey.value, retain: false, release: true, @@ -38735,14 +38920,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLTagNamesKey = _lookup('NSURLTagNamesKey'); - DartNSURLResourceKey get NSURLTagNamesKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLTagNamesKey => objc.NSString.fromPointer( _NSURLTagNamesKey.value, retain: true, release: true, ); set NSURLTagNamesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLTagNamesKey.value, retain: false, release: true, @@ -38754,14 +38939,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLPathKey = _lookup('NSURLPathKey'); - DartNSURLResourceKey get NSURLPathKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLPathKey => objc.NSString.fromPointer( _NSURLPathKey.value, retain: true, release: true, ); set NSURLPathKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLPathKey.value, retain: false, release: true, @@ -38773,15 +38958,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLCanonicalPathKey = _lookup('NSURLCanonicalPathKey'); - DartNSURLResourceKey get NSURLCanonicalPathKey => - objc.NSString.castFromPointer( - _NSURLCanonicalPathKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLCanonicalPathKey => objc.NSString.fromPointer( + _NSURLCanonicalPathKey.value, + retain: true, + release: true, + ); set NSURLCanonicalPathKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLCanonicalPathKey.value, retain: false, release: true, @@ -38793,15 +38977,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsMountTriggerKey = _lookup('NSURLIsMountTriggerKey'); - DartNSURLResourceKey get NSURLIsMountTriggerKey => - objc.NSString.castFromPointer( - _NSURLIsMountTriggerKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLIsMountTriggerKey => objc.NSString.fromPointer( + _NSURLIsMountTriggerKey.value, + retain: true, + release: true, + ); set NSURLIsMountTriggerKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsMountTriggerKey.value, retain: false, release: true, @@ -38814,14 +38997,14 @@ class NativeCupertinoHttp { _lookup('NSURLGenerationIdentifierKey'); DartNSURLResourceKey get NSURLGenerationIdentifierKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLGenerationIdentifierKey.value, retain: true, release: true, ); set NSURLGenerationIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLGenerationIdentifierKey.value, retain: false, release: true, @@ -38834,14 +39017,14 @@ class NativeCupertinoHttp { _lookup('NSURLDocumentIdentifierKey'); DartNSURLResourceKey get NSURLDocumentIdentifierKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLDocumentIdentifierKey.value, retain: true, release: true, ); set NSURLDocumentIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLDocumentIdentifierKey.value, retain: false, release: true, @@ -38854,14 +39037,14 @@ class NativeCupertinoHttp { _lookup('NSURLAddedToDirectoryDateKey'); DartNSURLResourceKey get NSURLAddedToDirectoryDateKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLAddedToDirectoryDateKey.value, retain: true, release: true, ); set NSURLAddedToDirectoryDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLAddedToDirectoryDateKey.value, retain: false, release: true, @@ -38874,14 +39057,14 @@ class NativeCupertinoHttp { _lookup('NSURLQuarantinePropertiesKey'); DartNSURLResourceKey get NSURLQuarantinePropertiesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLQuarantinePropertiesKey.value, retain: true, release: true, ); set NSURLQuarantinePropertiesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLQuarantinePropertiesKey.value, retain: false, release: true, @@ -38894,14 +39077,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileResourceTypeKey'); DartNSURLResourceKey get NSURLFileResourceTypeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeKey.value, retain: true, release: true, ); set NSURLFileResourceTypeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeKey.value, retain: false, release: true, @@ -38913,15 +39096,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLFileIdentifierKey = _lookup('NSURLFileIdentifierKey'); - DartNSURLResourceKey get NSURLFileIdentifierKey => - objc.NSString.castFromPointer( - _NSURLFileIdentifierKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLFileIdentifierKey => objc.NSString.fromPointer( + _NSURLFileIdentifierKey.value, + retain: true, + release: true, + ); set NSURLFileIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileIdentifierKey.value, retain: false, release: true, @@ -38934,14 +39116,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileContentIdentifierKey'); DartNSURLResourceKey get NSURLFileContentIdentifierKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileContentIdentifierKey.value, retain: true, release: true, ); set NSURLFileContentIdentifierKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileContentIdentifierKey.value, retain: false, release: true, @@ -38954,14 +39136,14 @@ class NativeCupertinoHttp { _lookup('NSURLMayShareFileContentKey'); DartNSURLResourceKey get NSURLMayShareFileContentKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLMayShareFileContentKey.value, retain: true, release: true, ); set NSURLMayShareFileContentKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLMayShareFileContentKey.value, retain: false, release: true, @@ -38974,14 +39156,14 @@ class NativeCupertinoHttp { _lookup('NSURLMayHaveExtendedAttributesKey'); DartNSURLResourceKey get NSURLMayHaveExtendedAttributesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLMayHaveExtendedAttributesKey.value, retain: true, release: true, ); set NSURLMayHaveExtendedAttributesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLMayHaveExtendedAttributesKey.value, retain: false, release: true, @@ -38994,14 +39176,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsPurgeableKey = _lookup('NSURLIsPurgeableKey'); - DartNSURLResourceKey get NSURLIsPurgeableKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsPurgeableKey => objc.NSString.fromPointer( _NSURLIsPurgeableKey.value, retain: true, release: true, ); set NSURLIsPurgeableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsPurgeableKey.value, retain: false, release: true, @@ -39013,14 +39195,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsSparseKey = _lookup('NSURLIsSparseKey'); - DartNSURLResourceKey get NSURLIsSparseKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsSparseKey => objc.NSString.fromPointer( _NSURLIsSparseKey.value, retain: true, release: true, ); set NSURLIsSparseKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsSparseKey.value, retain: false, release: true, @@ -39035,14 +39217,14 @@ class NativeCupertinoHttp { ); DartNSURLFileResourceType get NSURLFileResourceTypeNamedPipe => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeNamedPipe.value, retain: true, release: true, ); set NSURLFileResourceTypeNamedPipe(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeNamedPipe.value, retain: false, release: true, @@ -39056,14 +39238,14 @@ class NativeCupertinoHttp { ); DartNSURLFileResourceType get NSURLFileResourceTypeCharacterSpecial => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeCharacterSpecial.value, retain: true, release: true, ); set NSURLFileResourceTypeCharacterSpecial(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeCharacterSpecial.value, retain: false, release: true, @@ -39078,14 +39260,14 @@ class NativeCupertinoHttp { ); DartNSURLFileResourceType get NSURLFileResourceTypeDirectory => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeDirectory.value, retain: true, release: true, ); set NSURLFileResourceTypeDirectory(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeDirectory.value, retain: false, release: true, @@ -39099,14 +39281,14 @@ class NativeCupertinoHttp { ); DartNSURLFileResourceType get NSURLFileResourceTypeBlockSpecial => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeBlockSpecial.value, retain: true, release: true, ); set NSURLFileResourceTypeBlockSpecial(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeBlockSpecial.value, retain: false, release: true, @@ -39119,14 +39301,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileResourceTypeRegular'); DartNSURLFileResourceType get NSURLFileResourceTypeRegular => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeRegular.value, retain: true, release: true, ); set NSURLFileResourceTypeRegular(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeRegular.value, retain: false, release: true, @@ -39140,14 +39322,14 @@ class NativeCupertinoHttp { ); DartNSURLFileResourceType get NSURLFileResourceTypeSymbolicLink => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeSymbolicLink.value, retain: true, release: true, ); set NSURLFileResourceTypeSymbolicLink(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeSymbolicLink.value, retain: false, release: true, @@ -39160,14 +39342,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileResourceTypeSocket'); DartNSURLFileResourceType get NSURLFileResourceTypeSocket => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeSocket.value, retain: true, release: true, ); set NSURLFileResourceTypeSocket(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeSocket.value, retain: false, release: true, @@ -39179,14 +39361,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileResourceTypeUnknown'); DartNSURLFileResourceType get NSURLFileResourceTypeUnknown => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeUnknown.value, retain: true, release: true, ); set NSURLFileResourceTypeUnknown(DartNSURLFileResourceType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileResourceTypeUnknown.value, retain: false, release: true, @@ -39199,14 +39381,14 @@ class NativeCupertinoHttp { _lookup('NSURLThumbnailDictionaryKey'); DartNSURLResourceKey get NSURLThumbnailDictionaryKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLThumbnailDictionaryKey.value, retain: true, release: true, ); set NSURLThumbnailDictionaryKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLThumbnailDictionaryKey.value, retain: false, release: true, @@ -39218,14 +39400,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLThumbnailKey = _lookup('NSURLThumbnailKey'); - DartNSURLResourceKey get NSURLThumbnailKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLThumbnailKey => objc.NSString.fromPointer( _NSURLThumbnailKey.value, retain: true, release: true, ); set NSURLThumbnailKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLThumbnailKey.value, retain: false, release: true, @@ -39240,14 +39422,14 @@ class NativeCupertinoHttp { ); DartNSURLThumbnailDictionaryItem get NSThumbnail1024x1024SizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSThumbnail1024x1024SizeKey.value, retain: true, release: true, ); set NSThumbnail1024x1024SizeKey(DartNSURLThumbnailDictionaryItem value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSThumbnail1024x1024SizeKey.value, retain: false, release: true, @@ -39259,14 +39441,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLFileSizeKey = _lookup('NSURLFileSizeKey'); - DartNSURLResourceKey get NSURLFileSizeKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLFileSizeKey => objc.NSString.fromPointer( _NSURLFileSizeKey.value, retain: true, release: true, ); set NSURLFileSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileSizeKey.value, retain: false, release: true, @@ -39279,14 +39461,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileAllocatedSizeKey'); DartNSURLResourceKey get NSURLFileAllocatedSizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileAllocatedSizeKey.value, retain: true, release: true, ); set NSURLFileAllocatedSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileAllocatedSizeKey.value, retain: false, release: true, @@ -39298,15 +39480,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLTotalFileSizeKey = _lookup('NSURLTotalFileSizeKey'); - DartNSURLResourceKey get NSURLTotalFileSizeKey => - objc.NSString.castFromPointer( - _NSURLTotalFileSizeKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLTotalFileSizeKey => objc.NSString.fromPointer( + _NSURLTotalFileSizeKey.value, + retain: true, + release: true, + ); set NSURLTotalFileSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLTotalFileSizeKey.value, retain: false, release: true, @@ -39319,14 +39500,14 @@ class NativeCupertinoHttp { _lookup('NSURLTotalFileAllocatedSizeKey'); DartNSURLResourceKey get NSURLTotalFileAllocatedSizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLTotalFileAllocatedSizeKey.value, retain: true, release: true, ); set NSURLTotalFileAllocatedSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLTotalFileAllocatedSizeKey.value, retain: false, release: true, @@ -39338,14 +39519,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLIsAliasFileKey = _lookup('NSURLIsAliasFileKey'); - DartNSURLResourceKey get NSURLIsAliasFileKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLIsAliasFileKey => objc.NSString.fromPointer( _NSURLIsAliasFileKey.value, retain: true, release: true, ); set NSURLIsAliasFileKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsAliasFileKey.value, retain: false, release: true, @@ -39357,15 +39538,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLFileProtectionKey = _lookup('NSURLFileProtectionKey'); - DartNSURLResourceKey get NSURLFileProtectionKey => - objc.NSString.castFromPointer( - _NSURLFileProtectionKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLFileProtectionKey => objc.NSString.fromPointer( + _NSURLFileProtectionKey.value, + retain: true, + release: true, + ); set NSURLFileProtectionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionKey.value, retain: false, release: true, @@ -39378,14 +39558,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileProtectionNone'); DartNSURLFileProtectionType get NSURLFileProtectionNone => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionNone.value, retain: true, release: true, ); set NSURLFileProtectionNone(DartNSURLFileProtectionType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionNone.value, retain: false, release: true, @@ -39398,14 +39578,14 @@ class NativeCupertinoHttp { _lookup('NSURLFileProtectionComplete'); DartNSURLFileProtectionType get NSURLFileProtectionComplete => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionComplete.value, retain: true, release: true, ); set NSURLFileProtectionComplete(DartNSURLFileProtectionType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionComplete.value, retain: false, release: true, @@ -39420,14 +39600,14 @@ class NativeCupertinoHttp { ); DartNSURLFileProtectionType get NSURLFileProtectionCompleteUnlessOpen => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteUnlessOpen.value, retain: true, release: true, ); set NSURLFileProtectionCompleteUnlessOpen(DartNSURLFileProtectionType value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteUnlessOpen.value, retain: false, release: true, @@ -39445,7 +39625,7 @@ class NativeCupertinoHttp { DartNSURLFileProtectionType get NSURLFileProtectionCompleteUntilFirstUserAuthentication => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value, retain: true, release: true, @@ -39454,7 +39634,7 @@ class NativeCupertinoHttp { set NSURLFileProtectionCompleteUntilFirstUserAuthentication( DartNSURLFileProtectionType value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value, retain: false, release: true, @@ -39471,7 +39651,7 @@ class NativeCupertinoHttp { ); DartNSURLFileProtectionType get NSURLFileProtectionCompleteWhenUserInactive => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteWhenUserInactive.value, retain: true, release: true, @@ -39480,7 +39660,7 @@ class NativeCupertinoHttp { set NSURLFileProtectionCompleteWhenUserInactive( DartNSURLFileProtectionType value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLFileProtectionCompleteWhenUserInactive.value, retain: false, release: true, @@ -39494,14 +39674,14 @@ class NativeCupertinoHttp { _lookup('NSURLDirectoryEntryCountKey'); DartNSURLResourceKey get NSURLDirectoryEntryCountKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLDirectoryEntryCountKey.value, retain: true, release: true, ); set NSURLDirectoryEntryCountKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLDirectoryEntryCountKey.value, retain: false, release: true, @@ -39516,14 +39696,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeLocalizedFormatDescriptionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeLocalizedFormatDescriptionKey.value, retain: true, release: true, ); set NSURLVolumeLocalizedFormatDescriptionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeLocalizedFormatDescriptionKey.value, retain: false, release: true, @@ -39537,14 +39717,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeTotalCapacityKey'); DartNSURLResourceKey get NSURLVolumeTotalCapacityKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeTotalCapacityKey.value, retain: true, release: true, ); set NSURLVolumeTotalCapacityKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeTotalCapacityKey.value, retain: false, release: true, @@ -39557,14 +39737,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeAvailableCapacityKey'); DartNSURLResourceKey get NSURLVolumeAvailableCapacityKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityKey.value, retain: true, release: true, ); set NSURLVolumeAvailableCapacityKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityKey.value, retain: false, release: true, @@ -39577,14 +39757,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeResourceCountKey'); DartNSURLResourceKey get NSURLVolumeResourceCountKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeResourceCountKey.value, retain: true, release: true, ); set NSURLVolumeResourceCountKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeResourceCountKey.value, retain: false, release: true, @@ -39599,14 +39779,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsPersistentIDsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsPersistentIDsKey.value, retain: true, release: true, ); set NSURLVolumeSupportsPersistentIDsKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsPersistentIDsKey.value, retain: false, release: true, @@ -39622,14 +39802,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsSymbolicLinksKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSymbolicLinksKey.value, retain: true, release: true, ); set NSURLVolumeSupportsSymbolicLinksKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSymbolicLinksKey.value, retain: false, release: true, @@ -39643,14 +39823,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsHardLinksKey'); DartNSURLResourceKey get NSURLVolumeSupportsHardLinksKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsHardLinksKey.value, retain: true, release: true, ); set NSURLVolumeSupportsHardLinksKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsHardLinksKey.value, retain: false, release: true, @@ -39663,14 +39843,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsJournalingKey'); DartNSURLResourceKey get NSURLVolumeSupportsJournalingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsJournalingKey.value, retain: true, release: true, ); set NSURLVolumeSupportsJournalingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsJournalingKey.value, retain: false, release: true, @@ -39684,14 +39864,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsJournalingKey'); DartNSURLResourceKey get NSURLVolumeIsJournalingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsJournalingKey.value, retain: true, release: true, ); set NSURLVolumeIsJournalingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsJournalingKey.value, retain: false, release: true, @@ -39704,14 +39884,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsSparseFilesKey'); DartNSURLResourceKey get NSURLVolumeSupportsSparseFilesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSparseFilesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsSparseFilesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSparseFilesKey.value, retain: false, release: true, @@ -39725,14 +39905,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsZeroRunsKey'); DartNSURLResourceKey get NSURLVolumeSupportsZeroRunsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsZeroRunsKey.value, retain: true, release: true, ); set NSURLVolumeSupportsZeroRunsKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsZeroRunsKey.value, retain: false, release: true, @@ -39747,14 +39927,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsCaseSensitiveNamesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCaseSensitiveNamesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsCaseSensitiveNamesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCaseSensitiveNamesKey.value, retain: false, release: true, @@ -39770,14 +39950,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsCasePreservedNamesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCasePreservedNamesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsCasePreservedNamesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCasePreservedNamesKey.value, retain: false, release: true, @@ -39793,14 +39973,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsRootDirectoryDatesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsRootDirectoryDatesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsRootDirectoryDatesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsRootDirectoryDatesKey.value, retain: false, release: true, @@ -39814,14 +39994,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsVolumeSizesKey'); DartNSURLResourceKey get NSURLVolumeSupportsVolumeSizesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsVolumeSizesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsVolumeSizesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsVolumeSizesKey.value, retain: false, release: true, @@ -39835,14 +40015,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsRenamingKey'); DartNSURLResourceKey get NSURLVolumeSupportsRenamingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsRenamingKey.value, retain: true, release: true, ); set NSURLVolumeSupportsRenamingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsRenamingKey.value, retain: false, release: true, @@ -39857,14 +40037,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsAdvisoryFileLockingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsAdvisoryFileLockingKey.value, retain: true, release: true, ); set NSURLVolumeSupportsAdvisoryFileLockingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsAdvisoryFileLockingKey.value, retain: false, release: true, @@ -39880,14 +40060,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsExtendedSecurityKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsExtendedSecurityKey.value, retain: true, release: true, ); set NSURLVolumeSupportsExtendedSecurityKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsExtendedSecurityKey.value, retain: false, release: true, @@ -39901,14 +40081,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsBrowsableKey'); DartNSURLResourceKey get NSURLVolumeIsBrowsableKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsBrowsableKey.value, retain: true, release: true, ); set NSURLVolumeIsBrowsableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsBrowsableKey.value, retain: false, release: true, @@ -39921,14 +40101,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeMaximumFileSizeKey'); DartNSURLResourceKey get NSURLVolumeMaximumFileSizeKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeMaximumFileSizeKey.value, retain: true, release: true, ); set NSURLVolumeMaximumFileSizeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeMaximumFileSizeKey.value, retain: false, release: true, @@ -39941,14 +40121,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsEjectableKey'); DartNSURLResourceKey get NSURLVolumeIsEjectableKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsEjectableKey.value, retain: true, release: true, ); set NSURLVolumeIsEjectableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsEjectableKey.value, retain: false, release: true, @@ -39961,14 +40141,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsRemovableKey'); DartNSURLResourceKey get NSURLVolumeIsRemovableKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsRemovableKey.value, retain: true, release: true, ); set NSURLVolumeIsRemovableKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsRemovableKey.value, retain: false, release: true, @@ -39981,14 +40161,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsInternalKey'); DartNSURLResourceKey get NSURLVolumeIsInternalKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsInternalKey.value, retain: true, release: true, ); set NSURLVolumeIsInternalKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsInternalKey.value, retain: false, release: true, @@ -40001,14 +40181,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsAutomountedKey'); DartNSURLResourceKey get NSURLVolumeIsAutomountedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsAutomountedKey.value, retain: true, release: true, ); set NSURLVolumeIsAutomountedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsAutomountedKey.value, retain: false, release: true, @@ -40020,15 +40200,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLVolumeIsLocalKey = _lookup('NSURLVolumeIsLocalKey'); - DartNSURLResourceKey get NSURLVolumeIsLocalKey => - objc.NSString.castFromPointer( - _NSURLVolumeIsLocalKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLVolumeIsLocalKey => objc.NSString.fromPointer( + _NSURLVolumeIsLocalKey.value, + retain: true, + release: true, + ); set NSURLVolumeIsLocalKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsLocalKey.value, retain: false, release: true, @@ -40041,14 +40220,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsReadOnlyKey'); DartNSURLResourceKey get NSURLVolumeIsReadOnlyKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsReadOnlyKey.value, retain: true, release: true, ); set NSURLVolumeIsReadOnlyKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsReadOnlyKey.value, retain: false, release: true, @@ -40061,14 +40240,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeCreationDateKey'); DartNSURLResourceKey get NSURLVolumeCreationDateKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeCreationDateKey.value, retain: true, release: true, ); set NSURLVolumeCreationDateKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeCreationDateKey.value, retain: false, release: true, @@ -40081,14 +40260,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeURLForRemountingKey'); DartNSURLResourceKey get NSURLVolumeURLForRemountingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeURLForRemountingKey.value, retain: true, release: true, ); set NSURLVolumeURLForRemountingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeURLForRemountingKey.value, retain: false, release: true, @@ -40101,14 +40280,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeUUIDStringKey'); DartNSURLResourceKey get NSURLVolumeUUIDStringKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeUUIDStringKey.value, retain: true, release: true, ); set NSURLVolumeUUIDStringKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeUUIDStringKey.value, retain: false, release: true, @@ -40120,14 +40299,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLVolumeNameKey = _lookup('NSURLVolumeNameKey'); - DartNSURLResourceKey get NSURLVolumeNameKey => objc.NSString.castFromPointer( + DartNSURLResourceKey get NSURLVolumeNameKey => objc.NSString.fromPointer( _NSURLVolumeNameKey.value, retain: true, release: true, ); set NSURLVolumeNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeNameKey.value, retain: false, release: true, @@ -40140,14 +40319,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeLocalizedNameKey'); DartNSURLResourceKey get NSURLVolumeLocalizedNameKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeLocalizedNameKey.value, retain: true, release: true, ); set NSURLVolumeLocalizedNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeLocalizedNameKey.value, retain: false, release: true, @@ -40160,14 +40339,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsEncryptedKey'); DartNSURLResourceKey get NSURLVolumeIsEncryptedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsEncryptedKey.value, retain: true, release: true, ); set NSURLVolumeIsEncryptedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsEncryptedKey.value, retain: false, release: true, @@ -40180,14 +40359,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeIsRootFileSystemKey'); DartNSURLResourceKey get NSURLVolumeIsRootFileSystemKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsRootFileSystemKey.value, retain: true, release: true, ); set NSURLVolumeIsRootFileSystemKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeIsRootFileSystemKey.value, retain: false, release: true, @@ -40200,14 +40379,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsCompressionKey'); DartNSURLResourceKey get NSURLVolumeSupportsCompressionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCompressionKey.value, retain: true, release: true, ); set NSURLVolumeSupportsCompressionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsCompressionKey.value, retain: false, release: true, @@ -40221,14 +40400,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsFileCloningKey'); DartNSURLResourceKey get NSURLVolumeSupportsFileCloningKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsFileCloningKey.value, retain: true, release: true, ); set NSURLVolumeSupportsFileCloningKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsFileCloningKey.value, retain: false, release: true, @@ -40242,14 +40421,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeSupportsSwapRenamingKey'); DartNSURLResourceKey get NSURLVolumeSupportsSwapRenamingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSwapRenamingKey.value, retain: true, release: true, ); set NSURLVolumeSupportsSwapRenamingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsSwapRenamingKey.value, retain: false, release: true, @@ -40265,14 +40444,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsExclusiveRenamingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsExclusiveRenamingKey.value, retain: true, release: true, ); set NSURLVolumeSupportsExclusiveRenamingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsExclusiveRenamingKey.value, retain: false, release: true, @@ -40288,14 +40467,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsImmutableFilesKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsImmutableFilesKey.value, retain: true, release: true, ); set NSURLVolumeSupportsImmutableFilesKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsImmutableFilesKey.value, retain: false, release: true, @@ -40311,14 +40490,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsAccessPermissionsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsAccessPermissionsKey.value, retain: true, release: true, ); set NSURLVolumeSupportsAccessPermissionsKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsAccessPermissionsKey.value, retain: false, release: true, @@ -40334,14 +40513,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeSupportsFileProtectionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsFileProtectionKey.value, retain: true, release: true, ); set NSURLVolumeSupportsFileProtectionKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSupportsFileProtectionKey.value, retain: false, release: true, @@ -40357,7 +40536,7 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLVolumeAvailableCapacityForImportantUsageKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityForImportantUsageKey.value, retain: true, release: true, @@ -40366,7 +40545,7 @@ class NativeCupertinoHttp { set NSURLVolumeAvailableCapacityForImportantUsageKey( DartNSURLResourceKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityForImportantUsageKey.value, retain: false, release: true, @@ -40384,7 +40563,7 @@ class NativeCupertinoHttp { DartNSURLResourceKey get NSURLVolumeAvailableCapacityForOpportunisticUsageKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value, retain: true, release: true, @@ -40393,7 +40572,7 @@ class NativeCupertinoHttp { set NSURLVolumeAvailableCapacityForOpportunisticUsageKey( DartNSURLResourceKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value, retain: false, release: true, @@ -40406,15 +40585,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLVolumeTypeNameKey = _lookup('NSURLVolumeTypeNameKey'); - DartNSURLResourceKey get NSURLVolumeTypeNameKey => - objc.NSString.castFromPointer( - _NSURLVolumeTypeNameKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLVolumeTypeNameKey => objc.NSString.fromPointer( + _NSURLVolumeTypeNameKey.value, + retain: true, + release: true, + ); set NSURLVolumeTypeNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeTypeNameKey.value, retain: false, release: true, @@ -40426,15 +40604,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLVolumeSubtypeKey = _lookup('NSURLVolumeSubtypeKey'); - DartNSURLResourceKey get NSURLVolumeSubtypeKey => - objc.NSString.castFromPointer( - _NSURLVolumeSubtypeKey.value, - retain: true, - release: true, - ); + DartNSURLResourceKey get NSURLVolumeSubtypeKey => objc.NSString.fromPointer( + _NSURLVolumeSubtypeKey.value, + retain: true, + release: true, + ); set NSURLVolumeSubtypeKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeSubtypeKey.value, retain: false, release: true, @@ -40447,14 +40624,14 @@ class NativeCupertinoHttp { _lookup('NSURLVolumeMountFromLocationKey'); DartNSURLResourceKey get NSURLVolumeMountFromLocationKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeMountFromLocationKey.value, retain: true, release: true, ); set NSURLVolumeMountFromLocationKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLVolumeMountFromLocationKey.value, retain: false, release: true, @@ -40467,14 +40644,14 @@ class NativeCupertinoHttp { _lookup('NSURLIsUbiquitousItemKey'); DartNSURLResourceKey get NSURLIsUbiquitousItemKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsUbiquitousItemKey.value, retain: true, release: true, ); set NSURLIsUbiquitousItemKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLIsUbiquitousItemKey.value, retain: false, release: true, @@ -40489,14 +40666,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemHasUnresolvedConflictsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemHasUnresolvedConflictsKey.value, retain: true, release: true, ); set NSURLUbiquitousItemHasUnresolvedConflictsKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemHasUnresolvedConflictsKey.value, retain: false, release: true, @@ -40510,14 +40687,14 @@ class NativeCupertinoHttp { _lookup('NSURLUbiquitousItemIsDownloadedKey'); DartNSURLResourceKey get NSURLUbiquitousItemIsDownloadedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsDownloadedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsDownloadedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsDownloadedKey.value, retain: false, release: true, @@ -40533,14 +40710,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemIsDownloadingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsDownloadingKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsDownloadingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsDownloadingKey.value, retain: false, release: true, @@ -40554,14 +40731,14 @@ class NativeCupertinoHttp { _lookup('NSURLUbiquitousItemIsUploadedKey'); DartNSURLResourceKey get NSURLUbiquitousItemIsUploadedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsUploadedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsUploadedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsUploadedKey.value, retain: false, release: true, @@ -40575,14 +40752,14 @@ class NativeCupertinoHttp { _lookup('NSURLUbiquitousItemIsUploadingKey'); DartNSURLResourceKey get NSURLUbiquitousItemIsUploadingKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsUploadingKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsUploadingKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsUploadingKey.value, retain: false, release: true, @@ -40598,14 +40775,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemPercentDownloadedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemPercentDownloadedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemPercentDownloadedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemPercentDownloadedKey.value, retain: false, release: true, @@ -40621,14 +40798,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemPercentUploadedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemPercentUploadedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemPercentUploadedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemPercentUploadedKey.value, retain: false, release: true, @@ -40644,14 +40821,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemDownloadingStatusKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusKey.value, retain: true, release: true, ); set NSURLUbiquitousItemDownloadingStatusKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusKey.value, retain: false, release: true, @@ -40667,14 +40844,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemDownloadingErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingErrorKey.value, retain: true, release: true, ); set NSURLUbiquitousItemDownloadingErrorKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingErrorKey.value, retain: false, release: true, @@ -40690,14 +40867,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemUploadingErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemUploadingErrorKey.value, retain: true, release: true, ); set NSURLUbiquitousItemUploadingErrorKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemUploadingErrorKey.value, retain: false, release: true, @@ -40713,14 +40890,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemDownloadRequestedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadRequestedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemDownloadRequestedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadRequestedKey.value, retain: false, release: true, @@ -40736,14 +40913,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemContainerDisplayNameKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemContainerDisplayNameKey.value, retain: true, release: true, ); set NSURLUbiquitousItemContainerDisplayNameKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemContainerDisplayNameKey.value, retain: false, release: true, @@ -40759,14 +40936,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousItemIsExcludedFromSyncKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsExcludedFromSyncKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsExcludedFromSyncKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsExcludedFromSyncKey.value, retain: false, release: true, @@ -40780,14 +40957,14 @@ class NativeCupertinoHttp { _lookup('NSURLUbiquitousItemIsSharedKey'); DartNSURLResourceKey get NSURLUbiquitousItemIsSharedKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsSharedKey.value, retain: true, release: true, ); set NSURLUbiquitousItemIsSharedKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemIsSharedKey.value, retain: false, release: true, @@ -40802,14 +40979,14 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserRoleKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemCurrentUserRoleKey.value, retain: true, release: true, ); set NSURLUbiquitousSharedItemCurrentUserRoleKey(DartNSURLResourceKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemCurrentUserRoleKey.value, retain: false, release: true, @@ -40826,7 +41003,7 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserPermissionsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value, retain: true, release: true, @@ -40835,7 +41012,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemCurrentUserPermissionsKey( DartNSURLResourceKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value, retain: false, release: true, @@ -40851,7 +41028,7 @@ class NativeCupertinoHttp { ); DartNSURLResourceKey get NSURLUbiquitousSharedItemOwnerNameComponentsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value, retain: true, release: true, @@ -40860,7 +41037,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemOwnerNameComponentsKey( DartNSURLResourceKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value, retain: false, release: true, @@ -40878,7 +41055,7 @@ class NativeCupertinoHttp { DartNSURLResourceKey get NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value, retain: true, release: true, @@ -40887,7 +41064,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey( DartNSURLResourceKey value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value, retain: false, release: true, @@ -40906,7 +41083,7 @@ class NativeCupertinoHttp { DartNSURLUbiquitousItemDownloadingStatus get NSURLUbiquitousItemDownloadingStatusNotDownloaded => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value, retain: true, release: true, @@ -40915,7 +41092,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousItemDownloadingStatusNotDownloaded( DartNSURLUbiquitousItemDownloadingStatus value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value, retain: false, release: true, @@ -40933,7 +41110,7 @@ class NativeCupertinoHttp { DartNSURLUbiquitousItemDownloadingStatus get NSURLUbiquitousItemDownloadingStatusDownloaded => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusDownloaded.value, retain: true, release: true, @@ -40942,7 +41119,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousItemDownloadingStatusDownloaded( DartNSURLUbiquitousItemDownloadingStatus value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusDownloaded.value, retain: false, release: true, @@ -40959,17 +41136,16 @@ class NativeCupertinoHttp { ); DartNSURLUbiquitousItemDownloadingStatus - get NSURLUbiquitousItemDownloadingStatusCurrent => - objc.NSString.castFromPointer( - _NSURLUbiquitousItemDownloadingStatusCurrent.value, - retain: true, - release: true, - ); + get NSURLUbiquitousItemDownloadingStatusCurrent => objc.NSString.fromPointer( + _NSURLUbiquitousItemDownloadingStatusCurrent.value, + retain: true, + release: true, + ); set NSURLUbiquitousItemDownloadingStatusCurrent( DartNSURLUbiquitousItemDownloadingStatus value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousItemDownloadingStatusCurrent.value, retain: false, release: true, @@ -40985,7 +41161,7 @@ class NativeCupertinoHttp { ); DartNSURLUbiquitousSharedItemRole get NSURLUbiquitousSharedItemRoleOwner => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemRoleOwner.value, retain: true, release: true, @@ -40994,7 +41170,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemRoleOwner( DartNSURLUbiquitousSharedItemRole value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemRoleOwner.value, retain: false, release: true, @@ -41011,7 +41187,7 @@ class NativeCupertinoHttp { ); DartNSURLUbiquitousSharedItemRole - get NSURLUbiquitousSharedItemRoleParticipant => objc.NSString.castFromPointer( + get NSURLUbiquitousSharedItemRoleParticipant => objc.NSString.fromPointer( _NSURLUbiquitousSharedItemRoleParticipant.value, retain: true, release: true, @@ -41020,7 +41196,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemRoleParticipant( DartNSURLUbiquitousSharedItemRole value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemRoleParticipant.value, retain: false, release: true, @@ -41037,17 +41213,16 @@ class NativeCupertinoHttp { ); DartNSURLUbiquitousSharedItemPermissions - get NSURLUbiquitousSharedItemPermissionsReadOnly => - objc.NSString.castFromPointer( - _NSURLUbiquitousSharedItemPermissionsReadOnly.value, - retain: true, - release: true, - ); + get NSURLUbiquitousSharedItemPermissionsReadOnly => objc.NSString.fromPointer( + _NSURLUbiquitousSharedItemPermissionsReadOnly.value, + retain: true, + release: true, + ); set NSURLUbiquitousSharedItemPermissionsReadOnly( DartNSURLUbiquitousSharedItemPermissions value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemPermissionsReadOnly.value, retain: false, release: true, @@ -41065,7 +41240,7 @@ class NativeCupertinoHttp { DartNSURLUbiquitousSharedItemPermissions get NSURLUbiquitousSharedItemPermissionsReadWrite => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemPermissionsReadWrite.value, retain: true, release: true, @@ -41074,7 +41249,7 @@ class NativeCupertinoHttp { set NSURLUbiquitousSharedItemPermissionsReadWrite( DartNSURLUbiquitousSharedItemPermissions value, ) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLUbiquitousSharedItemPermissionsReadWrite.value, retain: false, release: true, @@ -41083,17 +41258,61 @@ class NativeCupertinoHttp { .retainAndReturnPointer(); } + /// returns the read-only value of the NSFileManagerSupportedSyncControls options as a NSNumber. + late final ffi.Pointer + _NSURLUbiquitousItemSupportedSyncControlsKey = _lookup( + 'NSURLUbiquitousItemSupportedSyncControlsKey', + ); + + DartNSURLResourceKey get NSURLUbiquitousItemSupportedSyncControlsKey => + objc.NSString.fromPointer( + _NSURLUbiquitousItemSupportedSyncControlsKey.value, + retain: true, + release: true, + ); + + set NSURLUbiquitousItemSupportedSyncControlsKey(DartNSURLResourceKey value) { + objc.NSString.fromPointer( + _NSURLUbiquitousItemSupportedSyncControlsKey.value, + retain: false, + release: true, + ).ref.release(); + _NSURLUbiquitousItemSupportedSyncControlsKey.value = value.ref + .retainAndReturnPointer(); + } + + /// returns a boolean. + late final ffi.Pointer _NSURLUbiquitousItemIsSyncPausedKey = + _lookup('NSURLUbiquitousItemIsSyncPausedKey'); + + DartNSURLResourceKey get NSURLUbiquitousItemIsSyncPausedKey => + objc.NSString.fromPointer( + _NSURLUbiquitousItemIsSyncPausedKey.value, + retain: true, + release: true, + ); + + set NSURLUbiquitousItemIsSyncPausedKey(DartNSURLResourceKey value) { + objc.NSString.fromPointer( + _NSURLUbiquitousItemIsSyncPausedKey.value, + retain: false, + release: true, + ).ref.release(); + _NSURLUbiquitousItemIsSyncPausedKey.value = value.ref + .retainAndReturnPointer(); + } + late final ffi.Pointer _NSGenericException = _lookup('NSGenericException'); - DartNSExceptionName get NSGenericException => objc.NSString.castFromPointer( + DartNSExceptionName get NSGenericException => objc.NSString.fromPointer( _NSGenericException.value, retain: true, release: true, ); set NSGenericException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSGenericException.value, retain: false, release: true, @@ -41104,14 +41323,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSRangeException = _lookup('NSRangeException'); - DartNSExceptionName get NSRangeException => objc.NSString.castFromPointer( + DartNSExceptionName get NSRangeException => objc.NSString.fromPointer( _NSRangeException.value, retain: true, release: true, ); set NSRangeException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSRangeException.value, retain: false, release: true, @@ -41123,14 +41342,14 @@ class NativeCupertinoHttp { _lookup('NSInvalidArgumentException'); DartNSExceptionName get NSInvalidArgumentException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidArgumentException.value, retain: true, release: true, ); set NSInvalidArgumentException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidArgumentException.value, retain: false, release: true, @@ -41142,14 +41361,14 @@ class NativeCupertinoHttp { _lookup('NSInternalInconsistencyException'); DartNSExceptionName get NSInternalInconsistencyException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInternalInconsistencyException.value, retain: true, release: true, ); set NSInternalInconsistencyException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInternalInconsistencyException.value, retain: false, release: true, @@ -41161,14 +41380,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSMallocException = _lookup('NSMallocException'); - DartNSExceptionName get NSMallocException => objc.NSString.castFromPointer( + DartNSExceptionName get NSMallocException => objc.NSString.fromPointer( _NSMallocException.value, retain: true, release: true, ); set NSMallocException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSMallocException.value, retain: false, release: true, @@ -41180,14 +41399,14 @@ class NativeCupertinoHttp { _lookup('NSObjectInaccessibleException'); DartNSExceptionName get NSObjectInaccessibleException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSObjectInaccessibleException.value, retain: true, release: true, ); set NSObjectInaccessibleException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSObjectInaccessibleException.value, retain: false, release: true, @@ -41199,14 +41418,14 @@ class NativeCupertinoHttp { _lookup('NSObjectNotAvailableException'); DartNSExceptionName get NSObjectNotAvailableException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSObjectNotAvailableException.value, retain: true, release: true, ); set NSObjectNotAvailableException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSObjectNotAvailableException.value, retain: false, release: true, @@ -41218,14 +41437,14 @@ class NativeCupertinoHttp { _lookup('NSDestinationInvalidException'); DartNSExceptionName get NSDestinationInvalidException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSDestinationInvalidException.value, retain: true, release: true, ); set NSDestinationInvalidException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSDestinationInvalidException.value, retain: false, release: true, @@ -41236,15 +41455,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSPortTimeoutException = _lookup('NSPortTimeoutException'); - DartNSExceptionName get NSPortTimeoutException => - objc.NSString.castFromPointer( - _NSPortTimeoutException.value, - retain: true, - release: true, - ); + DartNSExceptionName get NSPortTimeoutException => objc.NSString.fromPointer( + _NSPortTimeoutException.value, + retain: true, + release: true, + ); set NSPortTimeoutException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSPortTimeoutException.value, retain: false, release: true, @@ -41256,14 +41474,14 @@ class NativeCupertinoHttp { _lookup('NSInvalidSendPortException'); DartNSExceptionName get NSInvalidSendPortException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidSendPortException.value, retain: true, release: true, ); set NSInvalidSendPortException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidSendPortException.value, retain: false, release: true, @@ -41275,14 +41493,14 @@ class NativeCupertinoHttp { _lookup('NSInvalidReceivePortException'); DartNSExceptionName get NSInvalidReceivePortException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidReceivePortException.value, retain: true, release: true, ); set NSInvalidReceivePortException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvalidReceivePortException.value, retain: false, release: true, @@ -41293,14 +41511,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSPortSendException = _lookup('NSPortSendException'); - DartNSExceptionName get NSPortSendException => objc.NSString.castFromPointer( + DartNSExceptionName get NSPortSendException => objc.NSString.fromPointer( _NSPortSendException.value, retain: true, release: true, ); set NSPortSendException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSPortSendException.value, retain: false, release: true, @@ -41311,15 +41529,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSPortReceiveException = _lookup('NSPortReceiveException'); - DartNSExceptionName get NSPortReceiveException => - objc.NSString.castFromPointer( - _NSPortReceiveException.value, - retain: true, - release: true, - ); + DartNSExceptionName get NSPortReceiveException => objc.NSString.fromPointer( + _NSPortReceiveException.value, + retain: true, + release: true, + ); set NSPortReceiveException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSPortReceiveException.value, retain: false, release: true, @@ -41330,14 +41547,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSOldStyleException = _lookup('NSOldStyleException'); - DartNSExceptionName get NSOldStyleException => objc.NSString.castFromPointer( + DartNSExceptionName get NSOldStyleException => objc.NSString.fromPointer( _NSOldStyleException.value, retain: true, release: true, ); set NSOldStyleException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSOldStyleException.value, retain: false, release: true, @@ -41349,14 +41566,14 @@ class NativeCupertinoHttp { _lookup('NSInconsistentArchiveException'); DartNSExceptionName get NSInconsistentArchiveException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInconsistentArchiveException.value, retain: true, release: true, ); set NSInconsistentArchiveException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInconsistentArchiveException.value, retain: false, release: true, @@ -41394,17 +41611,19 @@ class NativeCupertinoHttp { void Function(ffi.Pointer) >(); - late final ffi.Pointer> _NSAssertionHandlerKey = - _lookup>('NSAssertionHandlerKey'); + late final ffi.Pointer> + _NSAssertionHandlerKey = _lookup>( + 'NSAssertionHandlerKey', + ); - objc.NSString get NSAssertionHandlerKey => objc.NSString.castFromPointer( + objc.NSString get NSAssertionHandlerKey => objc.NSString.fromPointer( _NSAssertionHandlerKey.value, retain: true, release: true, ); set NSAssertionHandlerKey(objc.NSString value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSAssertionHandlerKey.value, retain: false, release: true, @@ -41418,14 +41637,14 @@ class NativeCupertinoHttp { ); DartNSExceptionName get NSInvocationOperationVoidResultException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvocationOperationVoidResultException.value, retain: true, release: true, ); set NSInvocationOperationVoidResultException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvocationOperationVoidResultException.value, retain: false, release: true, @@ -41440,14 +41659,14 @@ class NativeCupertinoHttp { ); DartNSExceptionName get NSInvocationOperationCancelledException => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvocationOperationCancelledException.value, retain: true, release: true, ); set NSInvocationOperationCancelledException(DartNSExceptionName value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSInvocationOperationCancelledException.value, retain: false, release: true, @@ -41468,14 +41687,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSCocoaErrorDomain = _lookup('NSCocoaErrorDomain'); - DartNSErrorDomain get NSCocoaErrorDomain => objc.NSString.castFromPointer( + DartNSErrorDomain get NSCocoaErrorDomain => objc.NSString.fromPointer( _NSCocoaErrorDomain.value, retain: true, release: true, ); set NSCocoaErrorDomain(DartNSErrorDomain value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSCocoaErrorDomain.value, retain: false, release: true, @@ -41487,14 +41706,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSPOSIXErrorDomain = _lookup('NSPOSIXErrorDomain'); - DartNSErrorDomain get NSPOSIXErrorDomain => objc.NSString.castFromPointer( + DartNSErrorDomain get NSPOSIXErrorDomain => objc.NSString.fromPointer( _NSPOSIXErrorDomain.value, retain: true, release: true, ); set NSPOSIXErrorDomain(DartNSErrorDomain value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSPOSIXErrorDomain.value, retain: false, release: true, @@ -41505,14 +41724,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSOSStatusErrorDomain = _lookup('NSOSStatusErrorDomain'); - DartNSErrorDomain get NSOSStatusErrorDomain => objc.NSString.castFromPointer( + DartNSErrorDomain get NSOSStatusErrorDomain => objc.NSString.fromPointer( _NSOSStatusErrorDomain.value, retain: true, release: true, ); set NSOSStatusErrorDomain(DartNSErrorDomain value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSOSStatusErrorDomain.value, retain: false, release: true, @@ -41523,14 +41742,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSMachErrorDomain = _lookup('NSMachErrorDomain'); - DartNSErrorDomain get NSMachErrorDomain => objc.NSString.castFromPointer( + DartNSErrorDomain get NSMachErrorDomain => objc.NSString.fromPointer( _NSMachErrorDomain.value, retain: true, release: true, ); set NSMachErrorDomain(DartNSErrorDomain value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSMachErrorDomain.value, retain: false, release: true, @@ -41542,15 +41761,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSUnderlyingErrorKey = _lookup('NSUnderlyingErrorKey'); - DartNSErrorUserInfoKey get NSUnderlyingErrorKey => - objc.NSString.castFromPointer( - _NSUnderlyingErrorKey.value, - retain: true, - release: true, - ); + DartNSErrorUserInfoKey get NSUnderlyingErrorKey => objc.NSString.fromPointer( + _NSUnderlyingErrorKey.value, + retain: true, + release: true, + ); set NSUnderlyingErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSUnderlyingErrorKey.value, retain: false, release: true, @@ -41563,14 +41781,14 @@ class NativeCupertinoHttp { _lookup('NSMultipleUnderlyingErrorsKey'); DartNSErrorUserInfoKey get NSMultipleUnderlyingErrorsKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSMultipleUnderlyingErrorsKey.value, retain: true, release: true, ); set NSMultipleUnderlyingErrorsKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSMultipleUnderlyingErrorsKey.value, retain: false, release: true, @@ -41583,14 +41801,14 @@ class NativeCupertinoHttp { _lookup('NSLocalizedDescriptionKey'); DartNSErrorUserInfoKey get NSLocalizedDescriptionKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedDescriptionKey.value, retain: true, release: true, ); set NSLocalizedDescriptionKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedDescriptionKey.value, retain: false, release: true, @@ -41603,14 +41821,14 @@ class NativeCupertinoHttp { _lookup('NSLocalizedFailureReasonErrorKey'); DartNSErrorUserInfoKey get NSLocalizedFailureReasonErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedFailureReasonErrorKey.value, retain: true, release: true, ); set NSLocalizedFailureReasonErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedFailureReasonErrorKey.value, retain: false, release: true, @@ -41626,14 +41844,14 @@ class NativeCupertinoHttp { ); DartNSErrorUserInfoKey get NSLocalizedRecoverySuggestionErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedRecoverySuggestionErrorKey.value, retain: true, release: true, ); set NSLocalizedRecoverySuggestionErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedRecoverySuggestionErrorKey.value, retain: false, release: true, @@ -41649,14 +41867,14 @@ class NativeCupertinoHttp { ); DartNSErrorUserInfoKey get NSLocalizedRecoveryOptionsErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedRecoveryOptionsErrorKey.value, retain: true, release: true, ); set NSLocalizedRecoveryOptionsErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedRecoveryOptionsErrorKey.value, retain: false, release: true, @@ -41670,14 +41888,14 @@ class NativeCupertinoHttp { _lookup('NSRecoveryAttempterErrorKey'); DartNSErrorUserInfoKey get NSRecoveryAttempterErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSRecoveryAttempterErrorKey.value, retain: true, release: true, ); set NSRecoveryAttempterErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSRecoveryAttempterErrorKey.value, retain: false, release: true, @@ -41689,15 +41907,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSHelpAnchorErrorKey = _lookup('NSHelpAnchorErrorKey'); - DartNSErrorUserInfoKey get NSHelpAnchorErrorKey => - objc.NSString.castFromPointer( - _NSHelpAnchorErrorKey.value, - retain: true, - release: true, - ); + DartNSErrorUserInfoKey get NSHelpAnchorErrorKey => objc.NSString.fromPointer( + _NSHelpAnchorErrorKey.value, + retain: true, + release: true, + ); set NSHelpAnchorErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSHelpAnchorErrorKey.value, retain: false, release: true, @@ -41710,14 +41927,14 @@ class NativeCupertinoHttp { _lookup('NSDebugDescriptionErrorKey'); DartNSErrorUserInfoKey get NSDebugDescriptionErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSDebugDescriptionErrorKey.value, retain: true, release: true, ); set NSDebugDescriptionErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSDebugDescriptionErrorKey.value, retain: false, release: true, @@ -41730,14 +41947,14 @@ class NativeCupertinoHttp { _lookup('NSLocalizedFailureErrorKey'); DartNSErrorUserInfoKey get NSLocalizedFailureErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedFailureErrorKey.value, retain: true, release: true, ); set NSLocalizedFailureErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSLocalizedFailureErrorKey.value, retain: false, release: true, @@ -41750,14 +41967,14 @@ class NativeCupertinoHttp { _lookup('NSStringEncodingErrorKey'); DartNSErrorUserInfoKey get NSStringEncodingErrorKey => - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingErrorKey.value, retain: true, release: true, ); set NSStringEncodingErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSStringEncodingErrorKey.value, retain: false, release: true, @@ -41769,14 +41986,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSURLErrorKey = _lookup('NSURLErrorKey'); - DartNSErrorUserInfoKey get NSURLErrorKey => objc.NSString.castFromPointer( + DartNSErrorUserInfoKey get NSURLErrorKey => objc.NSString.fromPointer( _NSURLErrorKey.value, retain: true, release: true, ); set NSURLErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSURLErrorKey.value, retain: false, release: true, @@ -41788,15 +42005,14 @@ class NativeCupertinoHttp { late final ffi.Pointer _NSFilePathErrorKey = _lookup('NSFilePathErrorKey'); - DartNSErrorUserInfoKey get NSFilePathErrorKey => - objc.NSString.castFromPointer( - _NSFilePathErrorKey.value, - retain: true, - release: true, - ); + DartNSErrorUserInfoKey get NSFilePathErrorKey => objc.NSString.fromPointer( + _NSFilePathErrorKey.value, + retain: true, + release: true, + ); set NSFilePathErrorKey(DartNSErrorUserInfoKey value) { - objc.NSString.castFromPointer( + objc.NSString.fromPointer( _NSFilePathErrorKey.value, retain: false, release: true, @@ -41828,44 +42044,10 @@ _NativeCupertinoHttp_wrapBlockingBlock_1pl9qdv( ); @ffi.Native< - ffi.Pointer Function(ffi.Pointer) ->(isLeaf: true) -external ffi.Pointer -_NativeCupertinoHttp_wrapListenerBlock_xtuoz7( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) ->(isLeaf: true) -external ffi.Pointer -_NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - ffi.Pointer block, - ffi.Pointer listnerBlock, - ffi.Pointer context, -); - -@ffi.Native< - ffi.Bool Function(ffi.Pointer, ffi.Pointer) + ffi.Bool Function(ffi.Pointer, ffi.Pointer) >() external bool _NativeCupertinoHttp_protocolTrampoline_e3qsqz( - ffi.Pointer target, - ffi.Pointer arg0, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) ->() -external ffi.Pointer -_NativeCupertinoHttp_protocolTrampoline_1mbt9g9( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, ); @@ -41893,44 +42075,78 @@ _NativeCupertinoHttp_wrapBlockingBlock_18v1jvf( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_18v1jvf( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ); @ffi.Native< instancetype Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >() external instancetype _NativeCupertinoHttp_protocolTrampoline_xr62hr( - ffi.Pointer target, + ffi.Pointer target, + ffi.Pointer arg0, + ffi.Pointer arg1, +); + +@ffi.Native< + ffi.Pointer Function(ffi.Pointer) +>(isLeaf: true) +external ffi.Pointer +_NativeCupertinoHttp_wrapListenerBlock_xtuoz7( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) +>(isLeaf: true) +external ffi.Pointer +_NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + ffi.Pointer block, + ffi.Pointer listnerBlock, + ffi.Pointer context, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) +>() +external ffi.Pointer +_NativeCupertinoHttp_protocolTrampoline_1mbt9g9( + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, ); @ffi.Native< NSUInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, NSUInteger, ) >() external int _NativeCupertinoHttp_protocolTrampoline_17ap02x( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, int arg3, ); @@ -42310,20 +42526,20 @@ _NativeCupertinoHttp_wrapBlockingBlock_1otpo83( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_xx612k( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ); @@ -42351,19 +42567,19 @@ _NativeCupertinoHttp_wrapBlockingBlock_1tz5yf( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_1tz5yf( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ); @ffi.Native< @@ -42390,17 +42606,17 @@ _NativeCupertinoHttp_wrapBlockingBlock_fjrv01( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_fjrv01( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ); @ffi.Native< @@ -42427,22 +42643,22 @@ _NativeCupertinoHttp_wrapBlockingBlock_l2g8ke( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_l2g8ke( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ); @@ -42492,18 +42708,18 @@ _NativeCupertinoHttp_wrapBlockingBlock_bklti2( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_bklti2( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ); @@ -42531,19 +42747,19 @@ _NativeCupertinoHttp_wrapBlockingBlock_jyim80( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_jyim80( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, ffi.Pointer arg4, ); @@ -42572,20 +42788,20 @@ _NativeCupertinoHttp_wrapBlockingBlock_h68abb( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Int64, ffi.Int64, ) >() external void _NativeCupertinoHttp_protocolTrampoline_h68abb( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, @@ -42615,19 +42831,19 @@ _NativeCupertinoHttp_wrapBlockingBlock_ly2579( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Int64, ) >() external void _NativeCupertinoHttp_protocolTrampoline_ly2579( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, ); @@ -42656,21 +42872,21 @@ _NativeCupertinoHttp_wrapBlockingBlock_1lx650f( @ffi.Native< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, NSInteger, - ffi.Pointer, + ffi.Pointer, ) >() external void _NativeCupertinoHttp_protocolTrampoline_1lx650f( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ); @ffi.Native< @@ -42697,47 +42913,47 @@ _NativeCupertinoHttp_wrapBlockingBlock_1b3bb6a( @ffi.Native< instancetype Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ) >() external instancetype _NativeCupertinoHttp_protocolTrampoline_10z9f5k( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ); @ffi.Native< NSInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >() external int _NativeCupertinoHttp_protocolTrampoline_1ldqghh( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ); @ffi.Native< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >() -external ffi.Pointer +external ffi.Pointer _NativeCupertinoHttp_protocolTrampoline_1q0i84( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ffi.Pointer arg2, ); @@ -42764,10 +42980,10 @@ _NativeCupertinoHttp_wrapBlockingBlock_ovsamd( ); @ffi.Native< - ffi.Void Function(ffi.Pointer, ffi.Pointer) + ffi.Void Function(ffi.Pointer, ffi.Pointer) >() external void _NativeCupertinoHttp_protocolTrampoline_ovsamd( - ffi.Pointer target, + ffi.Pointer target, ffi.Pointer arg0, ); @@ -43293,7 +43509,7 @@ final class __sigaction extends ffi.Struct { external int sa_flags; } -final class sigaction extends ffi.Struct { +final class sigaction$1 extends ffi.Struct { external __sigaction_u __sigaction_u$1; @sigset_t() @@ -43307,7 +43523,7 @@ typedef sig_tFunction = ffi.Void Function(ffi.Int); typedef Dartsig_tFunction = void Function(int); typedef sig_t = ffi.Pointer>; -final class sigvec extends ffi.Struct { +final class sigvec$1 extends ffi.Struct { external ffi.Pointer> sv_handler; @@ -44045,7 +44261,7 @@ final class proc_rlimit_control_wakeupmon extends ffi.Struct { external int wm_rate; } -final class wait extends ffi.Opaque {} +final class wait$1 extends ffi.Opaque {} typedef ct_rune_t = __darwin_ct_rune_t; typedef rune_t = __darwin_rune_t; @@ -44082,77 +44298,11 @@ final class _malloc_zone_t extends ffi.Opaque {} typedef malloc_zone_t = _malloc_zone_t; typedef dev_t = __darwin_dev_t; typedef mode_t = __darwin_mode_t; -void _ObjCBlock_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, -) => block.ref.target - .cast>() - .asFunction()(); -ffi.Pointer _ObjCBlock_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer) - >(_ObjCBlock_ffiVoid_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_closureTrampoline( - ffi.Pointer block, -) => (objc.getBlockClosure(block) as void Function())(); -ffi.Pointer _ObjCBlock_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer) - >(_ObjCBlock_ffiVoid_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_listenerTrampoline( - ffi.Pointer block, -) { - (objc.getBlockClosure(block) as void Function())(); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable)> -_ObjCBlock_ffiVoid_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer) - >.listener(_ObjCBlock_ffiVoid_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, -) { - try { - (objc.getBlockClosure(block) as void Function())(); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Pointer) -> -_ObjCBlock_ffiVoid_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Pointer) -> -_ObjCBlock_ffiVoid_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -44170,7 +44320,7 @@ abstract final class ObjCBlock_ffiVoid { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -44187,11 +44337,7 @@ abstract final class ObjCBlock_ffiVoid { void Function() fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_closureCallable, - () => fn(), - keepIsolateAlive, - ), + objc.newClosureBlock(_closureCallable, () => fn(), keepIsolateAlive), retain: false, release: true, ); @@ -44210,7 +44356,7 @@ abstract final class ObjCBlock_ffiVoid { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), () => fn(), keepIsolateAlive, ); @@ -44238,12 +44384,12 @@ abstract final class ObjCBlock_ffiVoid { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), () => fn(), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), () => fn(), keepIsolateAlive, ); @@ -44260,10 +44406,74 @@ abstract final class ObjCBlock_ffiVoid { release: true, ); } + + static void _listenerTrampoline(ffi.Pointer block) { + (objc.getBlockClosure(block) as void Function())(); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable)> + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ) { + try { + (objc.getBlockClosure(block) as void Function())(); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Pointer) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Pointer) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline(ffi.Pointer block) => block + .ref + .target + .cast>() + .asFunction()(); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline(ffi.Pointer block) => + (objc.getBlockClosure(block) as void Function())(); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_CallExtension +extension ObjCBlock_ffiVoid$CallExtension on objc.ObjCBlock { void call() => ref.pointer.ref.invoke @@ -44277,55 +44487,13 @@ extension ObjCBlock_ffiVoid_CallExtension ); } -int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer arg0, ffi.Pointer arg1) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline, 0) - .cast(); -int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as int Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); -ffi.Pointer _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline, 0) - .cast(); - /// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Int Function(ffi.Pointer, ffi.Pointer) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -44353,10 +44521,7 @@ abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { objc.ObjCBlock< ffi.Int Function(ffi.Pointer, ffi.Pointer) >( - objc.newPointerBlock( - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -44380,7 +44545,7 @@ abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { ffi.Int Function(ffi.Pointer, ffi.Pointer) >( objc.newClosureBlock( - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable, + _closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1) => fn(arg0, arg1), keepIsolateAlive, @@ -44388,10 +44553,55 @@ abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { retain: false, release: true, ); + + static int _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + int Function(ffi.Pointer, ffi.Pointer) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline, 0) + .cast(); + static int _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as int Function(ffi.Pointer, ffi.Pointer))( + arg0, + arg1, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline, 0) + .cast(); } /// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_ffiInt_ffiVoid_ffiVoid_CallExtension +extension ObjCBlock_ffiInt_ffiVoid_ffiVoid$CallExtension on objc.ObjCBlock< ffi.Int Function(ffi.Pointer, ffi.Pointer) @@ -44485,7 +44695,7 @@ typedef fsfilcnt_t = __darwin_fsfilcnt_t; final class objc_class extends ffi.Opaque {} final class objc_object extends ffi.Struct { - external ffi.Pointer isaAsInt; + external ffi.Pointer isaAsInt; } final class objc_selector extends ffi.Opaque {} @@ -44501,82 +44711,29 @@ typedef NSUInteger = ffi.UnsignedLong; typedef DartNSUInteger = int; typedef __gnuc_va_list = __builtin_va_list; typedef va_list = __builtin_va_list; -typedef NSExceptionName = ffi.Pointer; +typedef NSExceptionName = ffi.Pointer; typedef DartNSExceptionName = objc.NSString; -typedef NSRunLoopMode = ffi.Pointer; +typedef NSRunLoopMode = ffi.Pointer; typedef DartNSRunLoopMode = objc.NSString; -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, - 0, - ) - .cast(); -int -_ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as int Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, - 0, - ) - .cast(); -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_NSComparisonResult_objcObjCObjectImpl_objcObjCObjectImpl { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >(pointer, retain: retain, release: release); @@ -44587,16 +44744,16 @@ abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject /// will result in a crash. static objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< NSInteger Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > > @@ -44604,14 +44761,11 @@ abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject ) => objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >( - objc.newPointerBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -44626,76 +44780,121 @@ abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > fromFunction( - objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) - fn, { + objc.NSComparisonResult Function(objc.ObjCObject, objc.ObjCObject) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >( objc.newClosureBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.ObjCObject(arg0, retain: true, release: true), + objc.ObjCObject(arg1, retain: true, release: true), ).value, keepIsolateAlive, ), retain: false, release: true, ); + + static int _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline, 0) + .cast(); + static int _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as int Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline, 0) + .cast(); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_NSComparisonResult_objcObjCObjectImpl_objcObjCObjectImpl$CallExtension on objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > { - objc.NSComparisonResult call( - objc.ObjCObjectBase arg0, - objc.ObjCObjectBase arg1, - ) => objc.NSComparisonResult.fromValue( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer), - ); + objc.NSComparisonResult call(objc.ObjCObject arg0, objc.ObjCObject arg1) => + objc.NSComparisonResult.fromValue( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer), + ); } typedef NSComparator = ffi.Pointer; typedef DartNSComparator = objc.ObjCBlock< NSInteger Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >; typedef ptrauth_extra_data_t = ffi.UnsignedLong; @@ -44753,7 +44952,7 @@ typedef DartFloat64 = double; final class Float80 extends ffi.Struct { @SInt16() - external int exp; + external int exp$1; @ffi.Array.multi([4]) external ffi.Array man; @@ -44761,7 +44960,7 @@ final class Float80 extends ffi.Struct { final class Float96 extends ffi.Struct { @ffi.Array.multi([2]) - external ffi.Array exp; + external ffi.Array exp$1; @ffi.Array.multi([4]) external ffi.Array man; @@ -45126,20 +45325,23 @@ final _objc_msgSend_1hz7y9r = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Long Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_setVersion_ = objc.registerName("setVersion:"); final _objc_msgSend_4sp4xj = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Long, ) @@ -45147,7 +45349,7 @@ final _objc_msgSend_4sp4xj = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ) @@ -45156,15 +45358,15 @@ late final _sel_classForCoder = objc.registerName("classForCoder"); final _objc_msgSend_151sglz = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ) >(); @@ -45174,18 +45376,18 @@ late final _sel_replacementObjectForCoder_ = objc.registerName( final _objc_msgSend_1sotr3r = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >(); late final _sel_awakeAfterUsingCoder_ = objc.registerName( @@ -45194,69 +45396,69 @@ late final _sel_awakeAfterUsingCoder_ = objc.registerName( /// NSCoderMethods extension NSCoderMethods on objc.NSObject { - /// version - static DartNSInteger version() { + /// awakeAfterUsingCoder: + objc.ObjCObject? awakeAfterUsingCoder(objc.NSCoder coder) { objc.checkOsVersionInternal( - 'NSObject.version', + 'NSObject.awakeAfterUsingCoder:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); - } - - /// setVersion: - static void setVersion(DartNSInteger aVersion) { - objc.checkOsVersionInternal( - 'NSObject.setVersion:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_awakeAfterUsingCoder_, + coder.ref.pointer, ); - _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: false, release: true); } /// classForCoder - objc.ObjCObjectBase get classForCoder { + objc.ObjCObject get classForCoder { objc.checkOsVersionInternal( 'NSObject.classForCoder', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_classForCoder); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_classForCoder); + return objc.ObjCObject($ret, retain: true, release: true); } /// replacementObjectForCoder: - objc.ObjCObjectBase? replacementObjectForCoder(objc.NSCoder coder) { + objc.ObjCObject? replacementObjectForCoder(objc.NSCoder coder) { objc.checkOsVersionInternal( 'NSObject.replacementObjectForCoder:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_replacementObjectForCoder_, coder.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } - /// awakeAfterUsingCoder: - objc.ObjCObjectBase? awakeAfterUsingCoder(objc.NSCoder coder) { + /// setVersion: + static void setVersion(DartNSInteger aVersion) { objc.checkOsVersionInternal( - 'NSObject.awakeAfterUsingCoder:', + 'NSObject.setVersion:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_awakeAfterUsingCoder_, - coder.ref.pointer, + _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); + } + + /// version + static DartNSInteger version() { + objc.checkOsVersionInternal( + 'NSObject.version', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), ); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); + return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); } } @@ -45265,24 +45467,24 @@ final _objc_msgSend_xtuoz7 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >(); /// NSDeprecatedMethods extension NSDeprecatedMethods on objc.NSObject { /// poseAsClass: - static void poseAsClass(objc.ObjCObjectBase aClass) { + static void poseAsClass(objc.ObjCObject aClass) { objc.checkOsVersionInternal( 'NSObject.poseAsClass:', iOS: (false, (2, 0, 0)), @@ -45303,17 +45505,17 @@ late final _sel_autoContentAccessingProxy = objc.registerName( /// NSDiscardableContentProxy extension NSDiscardableContentProxy on objc.NSObject { /// autoContentAccessingProxy - objc.ObjCObjectBase get autoContentAccessingProxy { + objc.ObjCObject get autoContentAccessingProxy { objc.checkOsVersionInternal( 'NSObject.autoContentAccessingProxy', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_autoContentAccessingProxy, ); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + return objc.ObjCObject($ret, retain: true, release: true); } } @@ -45361,13 +45563,14 @@ enum NSURLCacheStoragePolicy { /// objects that are stored in the framework's caching system. /// It is used to maintain characteristics and attributes of a cached /// object. -class NSCachedURLResponse extends objc.NSObject - implements objc.NSSecureCoding, objc.NSCopying { - NSCachedURLResponse._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +extension type NSCachedURLResponse._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSSecureCoding, + objc.NSCopying { + /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. + NSCachedURLResponse.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSCachedURLResponse', iOS: (false, (2, 0, 0)), @@ -45375,16 +45578,18 @@ class NSCachedURLResponse extends objc.NSObject ); } - /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. - NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. - NSCachedURLResponse.castFromPointer( - ffi.Pointer other, { + NSCachedURLResponse.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSCachedURLResponse', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + } } late final _class_NSURLCache = objc.getClass("NSURLCache"); @@ -45393,176 +45598,77 @@ final _objc_msgSend_19nvye5 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >(); - -/// WARNING: NSURLSessionDataTask is a stub. To generate bindings for this class, include -/// NSURLSessionDataTask in your config's objc-interfaces list. -/// -/// NSURLSessionDataTask -class NSURLSessionDataTask extends NSURLSessionTask { - NSURLSessionDataTask._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. - NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. - NSURLSessionDataTask.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - -late final _sel_storeCachedResponse_forDataTask_ = objc.registerName( - "storeCachedResponse:forDataTask:", -); -final _objc_msgSend_pfv6jd = objc.msgSendPointer +late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); +late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObject; +late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = objc + .registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); +final _objc_msgSend_1dqnse5 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer, ) > >() .asFunction< - void Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + int, + int, + ffi.Pointer, ) >(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target +late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = objc + .registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); +late final _class_NSURLRequest = objc.getClass("NSURLRequest"); +late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); +late final _sel_supportsSecureCoding = objc.registerName( + "supportsSecureCoding", +); +final _objc_msgSend_91o635 = objc.msgSendPointer .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSCachedURLResponse_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSCachedURLResponse_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSCachedURLResponse_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSCachedURLResponse_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, ) - >.listener(_ObjCBlock_ffiVoid_NSCachedURLResponse_blockingTrampoline) - ..keepIsolateAlive = false; + > + >() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_bool_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer( + static objc.ObjCBlock)> fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, - }) => objc.ObjCBlock( + }) => objc.ObjCBlock)>( pointer, retain: retain, release: release, @@ -45573,17 +45679,14 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock + static objc.ObjCBlock)> fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction arg0)> + ffi.NativeFunction arg0)> > ptr, - ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, - ptr.cast(), - ), + ) => objc.ObjCBlock)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -45596,514 +45699,64 @@ abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock fromFunction( - void Function(NSCachedURLResponse?) fn, { + static objc.ObjCBlock)> fromFunction( + bool Function(ffi.Pointer) fn, { bool keepIsolateAlive = true, - }) => objc.ObjCBlock( + }) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer( - arg0, - retain: true, - release: true, - ), - ), + _closureCallable, + (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive, ), retain: false, release: true, ); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock listener( - void Function(NSCachedURLResponse?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer( - arg0, - retain: false, - release: true, - ), - ), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking( - void Function(NSCachedURLResponse?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_blockingCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer( - arg0, - retain: false, - release: true, - ), - ), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer( - arg0, - retain: false, - release: true, - ), - ), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - raw, - rawListener, - objc.objCContext, - ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); - } + static bool _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast arg0)>>() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline, false) + .cast(); + static bool _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => (objc.getBlockClosure(block) as bool Function(ffi.Pointer))( + arg0, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline, false) + .cast(); } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension - on objc.ObjCBlock { - void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_bool_ffiVoid$CallExtension + on objc.ObjCBlock)> { + bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function( + ffi.Bool Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getCachedResponseForDataTask_completionHandler_ = objc - .registerName("getCachedResponseForDataTask:completionHandler:"); -final _objc_msgSend_o762yo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(); -late final _sel_removeCachedResponseForDataTask_ = objc.registerName( - "removeCachedResponseForDataTask:", -); - -/// NSURLSessionTaskAdditions -extension NSURLSessionTaskAdditions on NSURLCache { - /// storeCachedResponse:forDataTask: - void storeCachedResponse( - NSCachedURLResponse cachedResponse, { - required NSURLSessionDataTask forDataTask, - }) { - objc.checkOsVersionInternal( - 'NSURLCache.storeCachedResponse:forDataTask:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_storeCachedResponse_forDataTask_, - cachedResponse.ref.pointer, - forDataTask.ref.pointer, - ); - } - - /// getCachedResponseForDataTask:completionHandler: - void getCachedResponseForDataTask( - NSURLSessionDataTask dataTask, { - required objc.ObjCBlock - completionHandler, - }) { - objc.checkOsVersionInternal( - 'NSURLCache.getCachedResponseForDataTask:completionHandler:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_o762yo( - this.ref.pointer, - _sel_getCachedResponseForDataTask_completionHandler_, - dataTask.ref.pointer, - completionHandler.ref.pointer, - ); - } - - /// removeCachedResponseForDataTask: - void removeCachedResponseForDataTask(NSURLSessionDataTask dataTask) { - objc.checkOsVersionInternal( - 'NSURLCache.removeCachedResponseForDataTask:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_removeCachedResponseForDataTask_, - dataTask.ref.pointer, - ); - } -} - -late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); -late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = objc.ObjCObjectBase; -late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = objc - .registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); -final _objc_msgSend_1dqnse5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - ) - >(); -late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = objc - .registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); -late final _class_NSURLRequest = objc.getClass("NSURLRequest"); -late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); -late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); -late final _sel_valueForHTTPHeaderField_ = objc.registerName( - "valueForHTTPHeaderField:", -); -late final _sel_HTTPBody = objc.registerName("HTTPBody"); -late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); -late final _sel_HTTPShouldHandleCookies = objc.registerName( - "HTTPShouldHandleCookies", -); -final _objc_msgSend_91o635 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ) - >(); -late final _sel_HTTPShouldUsePipelining = objc.registerName( - "HTTPShouldUsePipelining", -); - -/// ! -/// @category NSURLRequest(NSHTTPURLRequest) -/// The NSHTTPURLRequest on NSURLRequest provides methods for accessing -/// information specific to HTTP protocol requests. -extension NSHTTPURLRequest on NSURLRequest { - /// ! - /// @abstract Returns the HTTP request method of the receiver. - /// @result the HTTP request method of the receiver. - objc.NSString? get HTTPMethod { - objc.checkOsVersionInternal( - 'NSURLRequest.HTTPMethod', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPMethod); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns a dictionary containing all the HTTP header fields - /// of the receiver. - /// @result a dictionary containing all the HTTP header fields of the - /// receiver. - objc.NSDictionary? get allHTTPHeaderFields { - objc.checkOsVersionInternal( - 'NSURLRequest.allHTTPHeaderFields', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_allHTTPHeaderFields, - ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - objc.NSString? valueForHTTPHeaderField(objc.NSString field) { - objc.checkOsVersionInternal( - 'NSURLRequest.valueForHTTPHeaderField:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_valueForHTTPHeaderField_, - field.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - /// @result The request body data of the receiver. - objc.NSData? get HTTPBody { - objc.checkOsVersionInternal( - 'NSURLRequest.HTTPBody', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the request body stream of the receiver - /// if any has been set - /// @discussion The stream is returned for examination only; it is - /// not safe for the caller to manipulate the stream in any way. Also - /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only - /// one can be set on a given request. Also note that the body stream is - /// preserved across copies, but is LOST when the request is coded via the - /// NSCoding protocol - /// @result The request body stream of the receiver. - objc.NSInputStream? get HTTPBodyStream { - objc.checkOsVersionInternal( - 'NSURLRequest.HTTPBodyStream', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBodyStream); - return _ret.address == 0 - ? null - : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Determine whether default cookie handling will happen for - /// this request. - /// @discussion NOTE: This value is not used prior to 10.3 - /// @result YES if cookies will be sent with and set for this request; - /// otherwise NO. - bool get HTTPShouldHandleCookies { - objc.checkOsVersionInternal( - 'NSURLRequest.HTTPShouldHandleCookies', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); - } - - /// ! - /// @abstract Reports whether the receiver is not expected to wait for the - /// previous response before transmitting. - /// @result YES if the receiver should transmit before the previous response - /// is received. NO if the receiver should wait for the previous response - /// before transmitting. - bool get HTTPShouldUsePipelining { - objc.checkOsVersionInternal( - 'NSURLRequest.HTTPShouldUsePipelining', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 7, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } -} - -late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); -late final _sel_supportsSecureCoding = objc.registerName( - "supportsSecureCoding", -); -bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_bool_ffiVoid_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => objc.ObjCBlock)>( - pointer, - retain: retain, - release: release, - ); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction arg0)> - > - ptr, - ) => objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true, - ); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock)> fromFunction( - bool Function(ffi.Pointer) fn, { - bool keepIsolateAlive = true, - }) => objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_bool_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0), - keepIsolateAlive, - ), - retain: false, - release: true, - ); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_ffiVoid_CallExtension - on objc.ObjCBlock)> { - bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - bool Function(ffi.Pointer, ffi.Pointer) - >()(ref.pointer, arg0); + bool Function(ffi.Pointer, ffi.Pointer) + >()(ref.pointer, arg0); } /// ! @@ -46194,20 +45847,20 @@ late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = objc.registerName( final _objc_msgSend_1ajs603 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Double, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, double, ) @@ -46222,27 +45875,30 @@ final _objc_msgSend_8jm3uo = objc.msgSendPointer .cast< ffi.NativeFunction< NSUInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); final _objc_msgSend_1ukqyt8 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -46250,14 +45906,14 @@ final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer .cast< ffi.NativeFunction< ffi.Double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -46344,13 +46000,16 @@ final _objc_msgSend_t4uaw1 = objc.msgSendPointer .cast< ffi.NativeFunction< NSUInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_allowsCellularAccess = objc.registerName( "allowsCellularAccess", @@ -46395,13 +46054,16 @@ final _objc_msgSend_i3avs9 = objc.msgSendPointer .cast< ffi.NativeFunction< NSUInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_requiresDNSSECValidation = objc.registerName( "requiresDNSSECValidation", @@ -46416,292 +46078,28 @@ late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); final _objc_msgSend_1cwp428 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) >(); late final _sel_alloc = objc.registerName("alloc"); -late final _sel_self = objc.registerName("self"); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer -_ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >( - objc.newPointerBlock( - _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, - ptr.cast(), - ), - retain: false, - release: true, - ); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - fromFunction( - objc.ObjCObjectBase Function(ffi.Pointer) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), - keepIsolateAlive, - ), - retain: false, - release: true, - ); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension - on - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0), - retain: true, - release: true, - ); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock, objc.NSCoder)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -46722,16 +46120,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock, objc.NSCoder)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -46750,11 +46145,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { bool keepIsolateAlive = true, }) => objc.ObjCBlock, objc.NSCoder)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSCoder.castFromPointer(arg1, retain: true, release: true), - ), + _closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSCoder.fromPointer(arg1, retain: true, release: true)), keepIsolateAlive, ), retain: false, @@ -46776,10 +46169,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true), + objc.NSCoder.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -46806,19 +46199,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true), + objc.NSCoder.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_blockingListenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true), + objc.NSCoder.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -46833,10 +46225,139 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { ffi.Void Function(ffi.Pointer, objc.NSCoder) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSCoder$CallExtension on objc.ObjCBlock, objc.NSCoder)> { void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref .pointer @@ -46847,7 +46368,7 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -46855,73 +46376,29 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer); } late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as instancetype Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) - .cast(); -/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) @@ -46933,7 +46410,7 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) @@ -46943,22 +46420,19 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { ffi.NativeFunction< instancetype Function( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) >( - objc.newPointerBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -46972,7 +46446,7 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) @@ -46982,17 +46456,17 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { bool keepIsolateAlive = true, }) => objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) >( objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => + _closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - objc.NSCoder.castFromPointer(arg1, retain: true, release: true), + objc.NSCoder.fromPointer(arg1, retain: true, release: true), )?.ref.retainAndReturnPointer() ?? ffi.nullptr, keepIsolateAlive, @@ -47000,13 +46474,61 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { retain: false, release: true, ); + + static instancetype _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static instancetype _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as instancetype Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension +/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +extension ObjCBlock_instancetype_ffiVoid_NSCoder$CallExtension on objc.ObjCBlock< - objc.Retained?> Function( + objc.Retained?> Function( ffi.Pointer, objc.NSCoder, ) @@ -47018,7 +46540,7 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension instancetype Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -47026,20 +46548,20 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer) .address == 0 ? null - : objc.ObjCObjectBase( + : objc.ObjCObject( ref.pointer.ref.invoke .cast< ffi.NativeFunction< instancetype Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -47047,7 +46569,7 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer), retain: false, @@ -47055,33 +46577,213 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension ); } -/// NSURLRequest -class NSURLRequest extends objc.NSObject - implements objc.NSSecureCoding, objc.NSCopying, objc.NSMutableCopying { - NSURLRequest._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); +late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); +late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); +late final _sel_valueForHTTPHeaderField_ = objc.registerName( + "valueForHTTPHeaderField:", +); +late final _sel_HTTPBody = objc.registerName("HTTPBody"); +late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); +late final _sel_HTTPShouldHandleCookies = objc.registerName( + "HTTPShouldHandleCookies", +); +late final _sel_HTTPShouldUsePipelining = objc.registerName( + "HTTPShouldUsePipelining", +); + +/// ! +/// @category NSURLRequest(NSHTTPURLRequest) +/// The NSHTTPURLRequest on NSURLRequest provides methods for accessing +/// information specific to HTTP protocol requests. +extension NSHTTPURLRequest on NSURLRequest { + /// ! + /// @abstract Returns the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + /// @result The request body data of the receiver. + objc.NSData? get HTTPBody { + objc.checkOsVersionInternal( + 'NSURLRequest.HTTPBody', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_HTTPBody); + return $ret.address == 0 + ? null + : objc.NSData.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns the request body stream of the receiver + /// if any has been set + /// @discussion The stream is returned for examination only; it is + /// not safe for the caller to manipulate the stream in any way. Also + /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only + /// one can be set on a given request. Also note that the body stream is + /// preserved across copies, but is LOST when the request is coded via the + /// NSCoding protocol + /// @result The request body stream of the receiver. + objc.NSInputStream? get HTTPBodyStream { + objc.checkOsVersionInternal( + 'NSURLRequest.HTTPBodyStream', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_HTTPBodyStream, + ); + return $ret.address == 0 + ? null + : objc.NSInputStream.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns the HTTP request method of the receiver. + /// @result the HTTP request method of the receiver. + objc.NSString? get HTTPMethod { + objc.checkOsVersionInternal( + 'NSURLRequest.HTTPMethod', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_HTTPMethod); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract Determine whether default cookie handling will happen for + /// this request. + /// @discussion NOTE: This value is not used prior to 10.3 + /// @result YES if cookies will be sent with and set for this request; + /// otherwise NO. + bool get HTTPShouldHandleCookies { + objc.checkOsVersionInternal( + 'NSURLRequest.HTTPShouldHandleCookies', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_HTTPShouldHandleCookies, + ); + } + + /// ! + /// @abstract Reports whether the receiver is not expected to wait for the + /// previous response before transmitting. + /// @result YES if the receiver should transmit before the previous response + /// is received. NO if the receiver should wait for the previous response + /// before transmitting. + bool get HTTPShouldUsePipelining { + objc.checkOsVersionInternal( + 'NSURLRequest.HTTPShouldUsePipelining', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_HTTPShouldUsePipelining, + ); + } + + /// ! + /// @abstract Returns a dictionary containing all the HTTP header fields + /// of the receiver. + /// @result a dictionary containing all the HTTP header fields of the + /// receiver. + objc.NSDictionary? get allHTTPHeaderFields { + objc.checkOsVersionInternal( + 'NSURLRequest.allHTTPHeaderFields', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_allHTTPHeaderFields, + ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField(objc.NSString field) { + objc.checkOsVersionInternal( + 'NSURLRequest.valueForHTTPHeaderField:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_valueForHTTPHeaderField_, + field.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } +} +/// NSURLRequest +extension type NSURLRequest._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSSecureCoding, + objc.NSCopying, + objc.NSMutableCopying { /// Constructs a [NSURLRequest] that points to the same underlying object as [other]. - NSURLRequest.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLRequest.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } /// Constructs a [NSURLRequest] that wraps the given raw object pointer. - NSURLRequest.castFromPointer( - ffi.Pointer other, { + NSURLRequest.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } /// Returns whether [obj] is an instance of [NSURLRequest]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLRequest, + ); + + /// alloc + static NSURLRequest alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSURLRequest, _sel_alloc); + return NSURLRequest.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLRequest allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( _class_NSURLRequest, + _sel_allocWithZone_, + zone, ); + return NSURLRequest.fromPointer($ret, retain: false, release: true); + } + + /// new + static NSURLRequest new$() { + final $ret = _objc_msgSend_151sglz(_class_NSURLRequest, _sel_new); + return NSURLRequest.fromPointer($ret, retain: false, release: true); } /// ! @@ -47099,17 +46801,12 @@ class NSURLRequest extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer, ); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635(_class_NSURLRequest, _sel_supportsSecureCoding); + return NSURLRequest.fromPointer($ret, retain: true, release: true); } /// ! @@ -47132,70 +46829,26 @@ class NSURLRequest extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1ajs603( + final $ret = _objc_msgSend_1ajs603( _class_NSURLRequest, _sel_requestWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, cachePolicy.value, timeoutInterval, ); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + return NSURLRequest.fromPointer($ret, retain: true, release: true); } - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL(objc.NSURL URL) { - objc.checkOsVersionInternal( - 'NSURLRequest.initWithURL:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_, - URL.ref.pointer, - ); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635(_class_NSURLRequest, _sel_supportsSecureCoding); } - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL and - /// cache policy. - /// @discussion This is the designated initializer for the - /// NSURLRequest class. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL$1( - objc.NSURL URL, { - required NSURLRequestCachePolicy cachePolicy, - required DartNSTimeInterval timeoutInterval, - }) { - objc.checkOsVersionInternal( - 'NSURLRequest.initWithURL:cachePolicy:timeoutInterval:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_1ajs603( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval, - ); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } + /// Returns a new instance of NSURLRequest constructed with the default `new` method. + NSURLRequest() : this.as(new$().object$); +} +extension NSURLRequest$Methods on NSURLRequest { /// ! /// @abstract Returns the URL of the receiver. /// @result The URL of the receiver. @@ -47205,84 +46858,10 @@ class NSURLRequest extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the cache policy of the receiver. - /// @result The cache policy of the receiver. - NSURLRequestCachePolicy get cachePolicy { - objc.checkOsVersionInternal( - 'NSURLRequest.cachePolicy', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); - return NSURLRequestCachePolicy.fromValue(_ret); - } - - /// ! - /// @abstract Returns the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - /// @result The timeout interval of the receiver. - DartNSTimeInterval get timeoutInterval { - objc.checkOsVersionInternal( - 'NSURLRequest.timeoutInterval', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); - } - - /// ! - /// @abstract The main document URL associated with this load. - /// @discussion This URL is used for the cookie "same domain as main - /// document" policy, and attributing the request as a sub-resource - /// of a user-specified URL. There may also be other future uses. - /// See setMainDocumentURL: - /// @result The main document URL. - objc.NSURL? get mainDocumentURL { - objc.checkOsVersionInternal( - 'NSURLRequest.mainDocumentURL', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_mainDocumentURL); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_URL); + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. - /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have - /// not explicitly set a networkServiceType (using the setNetworkServiceType method). - /// @result The NSURLRequestNetworkServiceType associated with this request. - NSURLRequestNetworkServiceType get networkServiceType { - objc.checkOsVersionInternal( - 'NSURLRequest.networkServiceType', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 7, 0)), - ); - final _ret = _objc_msgSend_t4uaw1( - this.ref.pointer, - _sel_networkServiceType, - ); - return NSURLRequestNetworkServiceType.fromValue(_ret); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } /// ! @@ -47296,41 +46875,56 @@ class NSURLRequest extends objc.NSObject iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_allowsCellularAccess); } /// ! /// @abstract returns whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @result YES if the receiver is allowed to use an interface marked as expensive to + /// network interfaces which have been marked as constrained. + /// @result YES if the receiver is allowed to use an interface marked as constrained to /// satisfy the request, NO otherwise. - bool get allowsExpensiveNetworkAccess { + bool get allowsConstrainedNetworkAccess { objc.checkOsVersionInternal( - 'NSURLRequest.allowsExpensiveNetworkAccess', + 'NSURLRequest.allowsConstrainedNetworkAccess', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); return _objc_msgSend_91o635( - this.ref.pointer, - _sel_allowsExpensiveNetworkAccess, + object$.ref.pointer, + _sel_allowsConstrainedNetworkAccess, ); } /// ! /// @abstract returns whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @result YES if the receiver is allowed to use an interface marked as constrained to + /// network interfaces which have been marked as expensive. + /// @result YES if the receiver is allowed to use an interface marked as expensive to /// satisfy the request, NO otherwise. - bool get allowsConstrainedNetworkAccess { + bool get allowsExpensiveNetworkAccess { objc.checkOsVersionInternal( - 'NSURLRequest.allowsConstrainedNetworkAccess', + 'NSURLRequest.allowsExpensiveNetworkAccess', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); return _objc_msgSend_91o635( - this.ref.pointer, - _sel_allowsConstrainedNetworkAccess, + object$.ref.pointer, + _sel_allowsExpensiveNetworkAccess, + ); + } + + /// ! + /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, + /// in a persistent per-process cache. This should only be set for hostnames whose resolutions + /// are not expected to change across networks. + /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, + /// NO otherwise. Defaults to NO. + bool get allowsPersistentDNS { + objc.checkOsVersionInternal( + 'NSURLRequest.allowsPersistentDNS', + iOS: (false, (18, 0, 0)), + macOS: (false, (15, 0, 0)), ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_allowsPersistentDNS); } /// ! @@ -47344,7 +46938,7 @@ class NSURLRequest extends objc.NSObject iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_assumesHTTP3Capable); } /// ! @@ -47358,39 +46952,21 @@ class NSURLRequest extends objc.NSObject iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0)), ); - final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); - return NSURLRequestAttribution.fromValue(_ret); - } - - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - bool get requiresDNSSECValidation { - objc.checkOsVersionInternal( - 'NSURLRequest.requiresDNSSECValidation', - iOS: (false, (16, 1, 0)), - macOS: (false, (13, 0, 0)), - ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_requiresDNSSECValidation, - ); + final $ret = _objc_msgSend_i3avs9(object$.ref.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue($ret); } /// ! - /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, - /// in a persistent per-process cache. This should only be set for hostnames whose resolutions - /// are not expected to change across networks. - /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, - /// NO otherwise. Defaults to NO. - bool get allowsPersistentDNS { + /// @abstract Returns the cache policy of the receiver. + /// @result The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { objc.checkOsVersionInternal( - 'NSURLRequest.allowsPersistentDNS', - iOS: (false, (18, 0, 0)), - macOS: (false, (15, 0, 0)), + 'NSURLRequest.cachePolicy', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsPersistentDNS); + final $ret = _objc_msgSend_8jm3uo(object$.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue($ret); } /// Cookie partition identifier used for cookie storage and retrieval. @@ -47400,13 +46976,22 @@ class NSURLRequest extends objc.NSObject iOS: (false, (18, 2, 0)), macOS: (false, (15, 2, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_cookiePartitionIdentifier, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// encodeWithCoder: + void encodeWithCoder(objc.NSCoder coder) { + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_encodeWithCoder_, + coder.ref.pointer, + ); } /// init @@ -47416,1169 +47001,1282 @@ class NSURLRequest extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), _sel_init, ); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLRequest new$() { - final _ret = _objc_msgSend_151sglz(_class_NSURLRequest, _sel_new); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSURLRequest allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLRequest, - _sel_allocWithZone_, - zone, - ); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSURLRequest alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSURLRequest, _sel_alloc); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSURLRequest self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSURLRequest retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSURLRequest autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder(objc.NSCoder coder) { - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_encodeWithCoder_, - coder.ref.pointer, - ); + return NSURLRequest.fromPointer($ret, retain: false, release: true); } /// initWithCoder: NSURLRequest? initWithCoder(objc.NSCoder coder) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithCoder_, coder.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : NSURLRequest.castFromPointer(_ret, retain: false, release: true); + : NSURLRequest.fromPointer($ret, retain: false, release: true); } - /// Returns a new instance of NSURLRequest constructed with the default `new` method. - factory NSURLRequest() => new$(); -} - -late final _sel_cachedResponseForRequest_ = objc.registerName( - "cachedResponseForRequest:", -); -late final _sel_storeCachedResponse_forRequest_ = objc.registerName( - "storeCachedResponse:forRequest:", -); -late final _sel_removeCachedResponseForRequest_ = objc.registerName( - "removeCachedResponseForRequest:", -); -late final _sel_removeAllCachedResponses = objc.registerName( - "removeAllCachedResponses", -); -final _objc_msgSend_1pl9qdv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(); -late final _sel_removeCachedResponsesSinceDate_ = objc.registerName( - "removeCachedResponsesSinceDate:", -); -late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); -final _objc_msgSend_xw2lbc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); -final _objc_msgSend_1i9r4xy = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ) - >(); -late final _sel_diskCapacity = objc.registerName("diskCapacity"); -late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); -late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); -late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); - -/// NSURLCache -class NSURLCache extends objc.NSObject { - NSURLCache._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL(objc.NSURL URL) { objc.checkOsVersionInternal( - 'NSURLCache', + 'NSURLRequest.initWithURL:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - } - - /// Constructs a [NSURLCache] that points to the same underlying object as [other]. - NSURLCache.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLCache] that wraps the given raw object pointer. - NSURLCache.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLCache]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLCache, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithURL_, + URL.ref.pointer, ); + return NSURLRequest.fromPointer($ret, retain: false, release: true); } /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///
    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static NSURLCache getSharedURLCache() { - objc.checkOsVersionInternal( - 'NSURLCache.sharedURLCache', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_sharedURLCache); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///

    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static void setSharedURLCache(NSURLCache value) { - objc.checkOsVersionInternal( - 'NSURLCache.setSharedURLCache:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - _objc_msgSend_xtuoz7( - _class_NSURLCache, - _sel_setSharedURLCache_, - value.ref.pointer, - ); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:diskPath: - /// @abstract Initializes an NSURLCache with the given capacity and - /// path. - /// @discussion The returned NSURLCache is backed by disk, so - /// developers can be more liberal with space when choosing the - /// capacity for this kind of cache. A disk cache measured in the tens - /// of megabytes should be acceptable in most cases. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. - /// @param path the path on disk where the cache data is stored. - /// @result an initialized NSURLCache, with the given capacity, backed - /// by disk. - NSURLCache initWithMemoryCapacity( - DartNSUInteger memoryCapacity, { - required DartNSUInteger diskCapacity, - objc.NSString? diskPath, + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL and + /// cache policy. + /// @discussion This is the designated initializer for the + /// NSURLRequest class. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL$1( + objc.NSURL URL, { + required NSURLRequestCachePolicy cachePolicy, + required DartNSTimeInterval timeoutInterval, }) { objc.checkOsVersionInternal( - 'NSURLCache.initWithMemoryCapacity:diskCapacity:diskPath:', + 'NSURLRequest.initWithURL:cachePolicy:timeoutInterval:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1dqnse5( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_diskPath_, - memoryCapacity, - diskCapacity, - diskPath?.ref.pointer ?? ffi.nullptr, - ); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:directoryURL: - /// @abstract Initializes an NSURLCache with the given capacity and directory. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. - /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. - /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. - NSURLCache initWithMemoryCapacity$1( - DartNSUInteger memoryCapacity, { - required DartNSUInteger diskCapacity, - objc.NSURL? directoryURL, - }) { - objc.checkOsVersionInternal( - 'NSURLCache.initWithMemoryCapacity:diskCapacity:directoryURL:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - final _ret = _objc_msgSend_1dqnse5( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, - memoryCapacity, - diskCapacity, - directoryURL?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_1ajs603( + object$.ref.retainAndReturnPointer(), + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval, ); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); + return NSURLRequest.fromPointer($ret, retain: false, release: true); } /// ! - /// @method cachedResponseForRequest: - /// @abstract Returns the NSCachedURLResponse stored in the cache with - /// the given request. - /// @discussion The method returns nil if there is no - /// NSCachedURLResponse stored using the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - /// @result The NSCachedURLResponse stored in the cache with the given - /// request, or nil if there is no NSCachedURLResponse stored with the - /// given request. - NSCachedURLResponse? cachedResponseForRequest(NSURLRequest request) { + /// @abstract The main document URL associated with this load. + /// @discussion This URL is used for the cookie "same domain as main + /// document" policy, and attributing the request as a sub-resource + /// of a user-specified URL. There may also be other future uses. + /// See setMainDocumentURL: + /// @result The main document URL. + objc.NSURL? get mainDocumentURL { objc.checkOsVersionInternal( - 'NSURLCache.cachedResponseForRequest:', + 'NSURLRequest.mainDocumentURL', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_cachedResponseForRequest_, - request.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_mainDocumentURL, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : NSCachedURLResponse.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// ! - /// @method storeCachedResponse:forRequest: - /// @abstract Stores the given NSCachedURLResponse in the cache using - /// the given request. - /// @param cachedResponse The cached response to store. - /// @param request the NSURLRequest to use as a key for the storage. - void storeCachedResponse( - NSCachedURLResponse cachedResponse, { - required NSURLRequest forRequest, - }) { - objc.checkOsVersionInternal( - 'NSURLCache.storeCachedResponse:forRequest:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_storeCachedResponse_forRequest_, - cachedResponse.ref.pointer, - forRequest.ref.pointer, - ); - } - - /// ! - /// @method removeCachedResponseForRequest: - /// @abstract Removes the NSCachedURLResponse from the cache that is - /// stored using the given request. - /// @discussion No action is taken if there is no NSCachedURLResponse - /// stored with the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - void removeCachedResponseForRequest(NSURLRequest request) { - objc.checkOsVersionInternal( - 'NSURLCache.removeCachedResponseForRequest:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_removeCachedResponseForRequest_, - request.ref.pointer, - ); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } /// ! - /// @method removeAllCachedResponses - /// @abstract Clears the given cache, removing all NSCachedURLResponse - /// objects that it stores. - void removeAllCachedResponses() { - objc.checkOsVersionInternal( - 'NSURLCache.removeAllCachedResponses', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllCachedResponses); - } - - /// ! - /// @method removeCachedResponsesSince: - /// @abstract Clears the given cache of any cached responses since the provided date. - void removeCachedResponsesSinceDate(objc.NSDate date) { - objc.checkOsVersionInternal( - 'NSURLCache.removeCachedResponsesSinceDate:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_removeCachedResponsesSinceDate_, - date.ref.pointer, - ); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - DartNSUInteger get memoryCapacity { - objc.checkOsVersionInternal( - 'NSURLCache.memoryCapacity', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_memoryCapacity); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - set memoryCapacity(DartNSUInteger value) { + /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. + /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have + /// not explicitly set a networkServiceType (using the setNetworkServiceType method). + /// @result The NSURLRequestNetworkServiceType associated with this request. + NSURLRequestNetworkServiceType get networkServiceType { objc.checkOsVersionInternal( - 'NSURLCache.setMemoryCapacity:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + 'NSURLRequest.networkServiceType', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0)), ); - _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setMemoryCapacity_, value); - } - - /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - DartNSUInteger get diskCapacity { - objc.checkOsVersionInternal( - 'NSURLCache.diskCapacity', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + final $ret = _objc_msgSend_t4uaw1( + object$.ref.pointer, + _sel_networkServiceType, ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_diskCapacity); + return NSURLRequestNetworkServiceType.fromValue($ret); } /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - set diskCapacity(DartNSUInteger value) { + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + bool get requiresDNSSECValidation { objc.checkOsVersionInternal( - 'NSURLCache.setDiskCapacity:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + 'NSURLRequest.requiresDNSSECValidation', + iOS: (false, (16, 1, 0)), + macOS: (false, (13, 0, 0)), ); - _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setDiskCapacity_, value); - } - - /// ! - /// @abstract Returns the current amount of space consumed by the - /// in-memory cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the in-memory cache. - /// @result the current usage of the in-memory cache of the receiver. - DartNSUInteger get currentMemoryUsage { - objc.checkOsVersionInternal( - 'NSURLCache.currentMemoryUsage', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_requiresDNSSECValidation, ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentMemoryUsage); } /// ! - /// @abstract Returns the current amount of space consumed by the - /// on-disk cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the on-disk cache. - /// @result the current usage of the on-disk cache of the receiver. - DartNSUInteger get currentDiskUsage { + /// @abstract Returns the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + /// @result The timeout interval of the receiver. + DartNSTimeInterval get timeoutInterval { objc.checkOsVersionInternal( - 'NSURLCache.currentDiskUsage', + 'NSURLRequest.timeoutInterval', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentDiskUsage); - } - - /// init - NSURLCache init() { - objc.checkOsVersionInternal( - 'NSURLCache.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLCache new$() { - final _ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_new); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSURLCache allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLCache, - _sel_allocWithZone_, - zone, - ); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSURLCache alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_alloc); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSURLCache self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSURLCache retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSURLCache autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_timeoutInterval) + : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_timeoutInterval); } - - /// Returns a new instance of NSURLCache constructed with the default `new` method. - factory NSURLCache() => new$(); } -typedef NSNotificationName = ffi.Pointer; -typedef DartNSNotificationName = objc.NSString; -late final _class_NSNotification = objc.getClass("NSNotification"); -late final _sel_notificationWithName_object_ = objc.registerName( - "notificationWithName:object:", +late final _sel_cachedResponseForRequest_ = objc.registerName( + "cachedResponseForRequest:", ); -final _objc_msgSend_15qeuct = objc.msgSendPointer +late final _sel_storeCachedResponse_forRequest_ = objc.registerName( + "storeCachedResponse:forRequest:", +); +final _objc_msgSend_pfv6jd = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >(); -late final _sel_notificationWithName_object_userInfo_ = objc.registerName( - "notificationWithName:object:userInfo:", +late final _sel_removeCachedResponseForRequest_ = objc.registerName( + "removeCachedResponseForRequest:", ); -final _objc_msgSend_11spmsz = objc.msgSendPointer +late final _sel_removeAllCachedResponses = objc.registerName( + "removeAllCachedResponses", +); +final _objc_msgSend_1pl9qdv = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ) >(); - -/// NSNotificationCreation -extension NSNotificationCreation on objc.NSNotification { - /// notificationWithName:object: - static objc.NSNotification notificationWithName( - DartNSNotificationName aName, { - objc.ObjCObjectBase? object, - }) { - final _ret = _objc_msgSend_15qeuct( - _class_NSNotification, - _sel_notificationWithName_object_, - aName.ref.pointer, - object?.ref.pointer ?? ffi.nullptr, - ); - return objc.NSNotification.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// notificationWithName:object:userInfo: - static objc.NSNotification notificationWithName$1( - DartNSNotificationName aName, { - objc.ObjCObjectBase? object, - objc.NSDictionary? userInfo, - }) { - final _ret = _objc_msgSend_11spmsz( - _class_NSNotification, - _sel_notificationWithName_object_userInfo_, - aName.ref.pointer, - object?.ref.pointer ?? ffi.nullptr, - userInfo?.ref.pointer ?? ffi.nullptr, - ); - return objc.NSNotification.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// init - objc.NSNotification init() { - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return objc.NSNotification.castFromPointer( - _ret, - retain: false, - release: true, - ); - } -} - -late final _class_NSDate = objc.getClass("NSDate"); -late final _sel_date = objc.registerName("date"); -late final _sel_dateWithTimeIntervalSinceNow_ = objc.registerName( - "dateWithTimeIntervalSinceNow:", +late final _sel_removeCachedResponsesSinceDate_ = objc.registerName( + "removeCachedResponsesSinceDate:", ); -final _objc_msgSend_oa8mke = objc.msgSendPointer +late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); +final _objc_msgSend_xw2lbc = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer, - ffi.Double, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + int Function( + ffi.Pointer, ffi.Pointer, - double, ) >(); -late final _sel_dateWithTimeIntervalSinceReferenceDate_ = objc.registerName( - "dateWithTimeIntervalSinceReferenceDate:", -); -late final _sel_dateWithTimeIntervalSince1970_ = objc.registerName( - "dateWithTimeIntervalSince1970:", -); -late final _sel_dateWithTimeInterval_sinceDate_ = objc.registerName( - "dateWithTimeInterval:sinceDate:", -); -final _objc_msgSend_1ozwf6k = objc.msgSendPointer +late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); +final _objc_msgSend_1i9r4xy = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Void Function( + ffi.Pointer, ffi.Pointer, - ffi.Double, - ffi.Pointer, + ffi.UnsignedLong, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + void Function( + ffi.Pointer, ffi.Pointer, - double, - ffi.Pointer, + int, ) >(); -late final _sel_distantFuture = objc.registerName("distantFuture"); -late final _sel_distantPast = objc.registerName("distantPast"); -late final _sel_now = objc.registerName("now"); -late final _sel_initWithTimeIntervalSinceNow_ = objc.registerName( - "initWithTimeIntervalSinceNow:", -); -late final _sel_initWithTimeIntervalSince1970_ = objc.registerName( - "initWithTimeIntervalSince1970:", -); -late final _sel_initWithTimeInterval_sinceDate_ = objc.registerName( - "initWithTimeInterval:sinceDate:", -); +late final _sel_diskCapacity = objc.registerName("diskCapacity"); +late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); +late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); +late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); -/// NSDateCreation -extension NSDateCreation on objc.NSDate { - /// date - static objc.NSDate date() { - final _ret = _objc_msgSend_151sglz(_class_NSDate, _sel_date); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +/// WARNING: NSURLSessionDataTask is a stub. To generate bindings for this class, include +/// NSURLSessionDataTask in your config's objc-interfaces list. +/// +/// NSURLSessionDataTask +extension type NSURLSessionDataTask._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLSessionTask { + /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. + NSURLSessionDataTask.as(objc.ObjCObject other) : object$ = other {} - /// dateWithTimeIntervalSinceNow: - static objc.NSDate dateWithTimeIntervalSinceNow(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_oa8mke( - _class_NSDate, - _sel_dateWithTimeIntervalSinceNow_, - secs, - ); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. + NSURLSessionDataTask.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} +} - /// dateWithTimeIntervalSinceReferenceDate: - static objc.NSDate dateWithTimeIntervalSinceReferenceDate( - DartNSTimeInterval ti, - ) { - final _ret = _objc_msgSend_oa8mke( - _class_NSDate, - _sel_dateWithTimeIntervalSinceReferenceDate_, - ti, - ); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +late final _sel_storeCachedResponse_forDataTask_ = objc.registerName( + "storeCachedResponse:forDataTask:", +); - /// dateWithTimeIntervalSince1970: - static objc.NSDate dateWithTimeIntervalSince1970(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_oa8mke( - _class_NSDate, - _sel_dateWithTimeIntervalSince1970_, - secs, - ); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock( + pointer, + retain: retain, + release: release, + ); - /// dateWithTimeInterval:sinceDate: - static objc.NSDate dateWithTimeInterval( - DartNSTimeInterval secsToBeAdded, { - required objc.NSDate sinceDate, - }) { - final _ret = _objc_msgSend_1ozwf6k( - _class_NSDate, - _sel_dateWithTimeInterval_sinceDate_, - secsToBeAdded, - sinceDate.ref.pointer, - ); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// distantFuture - static objc.NSDate getDistantFuture() { - final _ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantFuture); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + > + ptr, + ) => objc.ObjCBlock( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); - /// distantPast - static objc.NSDate getDistantPast() { - final _ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantPast); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock fromFunction( + void Function(NSCachedURLResponse?) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : NSCachedURLResponse.fromPointer( + arg0, + retain: true, + release: true, + ), + ), + keepIsolateAlive, + ), + retain: false, + release: true, + ); - /// now - static objc.NSDate getNow() { - objc.checkOsVersionInternal( - 'NSDate.now', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener( + void Function(NSCachedURLResponse?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : NSCachedURLResponse.fromPointer( + arg0, + retain: false, + release: true, + ), + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); - final _ret = _objc_msgSend_151sglz(_class_NSDate, _sel_now); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// initWithTimeIntervalSinceNow: - objc.NSDate initWithTimeIntervalSinceNow(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_oa8mke( - this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceNow_, - secs, + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock blocking( + void Function(NSCachedURLResponse?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : NSCachedURLResponse.fromPointer( + arg0, + retain: false, + release: true, + ), + ), + keepIsolateAlive, + ); + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : NSCachedURLResponse.fromPointer( + arg0, + retain: false, + release: true, + ), + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, + rawListener, + objc.objCContext, + ); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } - /// initWithTimeIntervalSince1970: - objc.NSDate initWithTimeIntervalSince1970(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_oa8mke( - this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSince1970_, - secs, - ); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); } - /// initWithTimeInterval:sinceDate: - objc.NSDate initWithTimeInterval( - DartNSTimeInterval secsToBeAdded, { - required objc.NSDate sinceDate, - }) { - final _ret = _objc_msgSend_1ozwf6k( - this.ref.retainAndReturnPointer(), - _sel_initWithTimeInterval_sinceDate_, - secsToBeAdded, - sinceDate.ref.pointer, - ); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); -late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); -late final _sel_setAllHTTPHeaderFields_ = objc.registerName( - "setAllHTTPHeaderFields:", -); -late final _sel_setValue_forHTTPHeaderField_ = objc.registerName( - "setValue:forHTTPHeaderField:", -); -late final _sel_addValue_forHTTPHeaderField_ = objc.registerName( - "addValue:forHTTPHeaderField:", -); -late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); -late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); -late final _sel_setHTTPShouldHandleCookies_ = objc.registerName( - "setHTTPShouldHandleCookies:", -); -final _objc_msgSend_1s56lr9 = objc.msgSendPointer +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCachedURLResponse$CallExtension + on objc.ObjCBlock { + void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_getCachedResponseForDataTask_completionHandler_ = objc + .registerName("getCachedResponseForDataTask:completionHandler:"); +final _objc_msgSend_o762yo = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Bool, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - bool, + ffi.Pointer, + ffi.Pointer, ) >(); -late final _sel_setHTTPShouldUsePipelining_ = objc.registerName( - "setHTTPShouldUsePipelining:", +late final _sel_removeCachedResponseForDataTask_ = objc.registerName( + "removeCachedResponseForDataTask:", ); -/// ! -/// @category NSMutableURLRequest(NSMutableHTTPURLRequest) -/// The NSMutableHTTPURLRequest on NSMutableURLRequest provides methods -/// for configuring information specific to HTTP protocol requests. -extension NSMutableHTTPURLRequest on NSMutableURLRequest { - /// ! - /// @abstract Sets the HTTP request method of the receiver. - objc.NSString get HTTPMethod { +/// NSURLSessionTaskAdditions +extension NSURLSessionTaskAdditions on NSURLCache { + /// getCachedResponseForDataTask:completionHandler: + void getCachedResponseForDataTask( + NSURLSessionDataTask dataTask, { + required objc.ObjCBlock + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.HTTPMethod', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + 'NSURLCache.getCachedResponseForDataTask:completionHandler:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_o762yo( + object$.ref.pointer, + _sel_getCachedResponseForDataTask_completionHandler_, + dataTask.ref.pointer, + completionHandler.ref.pointer, ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPMethod); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the HTTP request method of the receiver. - set HTTPMethod(objc.NSString value) { + /// removeCachedResponseForDataTask: + void removeCachedResponseForDataTask(NSURLSessionDataTask dataTask) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setHTTPMethod:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + 'NSURLCache.removeCachedResponseForDataTask:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setHTTPMethod_, - value.ref.pointer, + object$.ref.pointer, + _sel_removeCachedResponseForDataTask_, + dataTask.ref.pointer, ); } - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - objc.NSDictionary? get allHTTPHeaderFields { + /// storeCachedResponse:forDataTask: + void storeCachedResponse$1( + NSCachedURLResponse cachedResponse, { + required NSURLSessionDataTask forDataTask, + }) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.allHTTPHeaderFields', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + 'NSURLCache.storeCachedResponse:forDataTask:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_allHTTPHeaderFields, + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_storeCachedResponse_forDataTask_, + cachedResponse.ref.pointer, + forDataTask.ref.pointer, ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } +} - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - set allHTTPHeaderFields(objc.NSDictionary? value) { +/// NSURLCache +extension type NSURLCache._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSURLCache] that points to the same underlying object as [other]. + NSURLCache.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAllHTTPHeaderFields:', + 'NSURLCache', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setAllHTTPHeaderFields_, - value?.ref.pointer ?? ffi.nullptr, - ); + assert(isA(object$)); } - /// ! - /// @method setValue:forHTTPHeaderField: - /// @abstract Sets the value of the given HTTP header field. - /// @discussion If a value was previously set for the given header - /// field, that value is replaced with the given value. Note that, in - /// keeping with the HTTP RFC, HTTP header field names are - /// case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void setValue( - objc.NSString? value, { - required objc.NSString forHTTPHeaderField, - }) { + /// Constructs a [NSURLCache] that wraps the given raw object pointer. + NSURLCache.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setValue:forHTTPHeaderField:', + 'NSURLCache', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_setValue_forHTTPHeaderField_, - value?.ref.pointer ?? ffi.nullptr, - forHTTPHeaderField.ref.pointer, + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLCache, + ); + + /// alloc + static NSURLCache alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_alloc); + return NSURLCache.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLCache allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLCache, + _sel_allocWithZone_, + zone, ); + return NSURLCache.fromPointer($ret, retain: false, release: true); + } + + /// new + static NSURLCache new$() { + final $ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_new); + return NSURLCache.fromPointer($ret, retain: false, release: true); } /// ! - /// @method addValue:forHTTPHeaderField: - /// @abstract Adds an HTTP header field in the current header - /// dictionary. - /// @discussion This method provides a way to add values to header - /// fields incrementally. If a value was previously set for the given - /// header field, the given value is appended to the previously-existing - /// value. The appropriate field delimiter, a comma in the case of HTTP, - /// is added by the implementation, and should not be added to the given - /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP - /// header field names are case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void addValue( - objc.NSString value, { - required objc.NSString forHTTPHeaderField, - }) { + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static void setSharedURLCache(NSURLCache value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.addValue:forHTTPHeaderField:', + 'NSURLCache.setSharedURLCache:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_addValue_forHTTPHeaderField_, + _objc_msgSend_xtuoz7( + _class_NSURLCache, + _sel_setSharedURLCache_, value.ref.pointer, - forHTTPHeaderField.ref.pointer, ); } /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - objc.NSData? get HTTPBody { + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static NSURLCache getSharedURLCache() { objc.checkOsVersionInternal( - 'NSMutableURLRequest.HTTPBody', + 'NSURLCache.sharedURLCache', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz(_class_NSURLCache, _sel_sharedURLCache); + return NSURLCache.fromPointer($ret, retain: true, release: true); } + /// Returns a new instance of NSURLCache constructed with the default `new` method. + NSURLCache() : this.as(new$().object$); +} + +extension NSURLCache$Methods on NSURLCache { /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - set HTTPBody(objc.NSData? value) { + /// @method cachedResponseForRequest: + /// @abstract Returns the NSCachedURLResponse stored in the cache with + /// the given request. + /// @discussion The method returns nil if there is no + /// NSCachedURLResponse stored using the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + /// @result The NSCachedURLResponse stored in the cache with the given + /// request, or nil if there is no NSCachedURLResponse stored with the + /// given request. + NSCachedURLResponse? cachedResponseForRequest(NSURLRequest request) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setHTTPBody:', + 'NSURLCache.cachedResponseForRequest:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setHTTPBody_, - value?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_cachedResponseForRequest_, + request.ref.pointer, ); + return $ret.address == 0 + ? null + : NSCachedURLResponse.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - objc.NSInputStream? get HTTPBodyStream { + /// @abstract Returns the current amount of space consumed by the + /// on-disk cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the on-disk cache. + /// @result the current usage of the on-disk cache of the receiver. + DartNSUInteger get currentDiskUsage { objc.checkOsVersionInternal( - 'NSMutableURLRequest.HTTPBodyStream', + 'NSURLCache.currentDiskUsage', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_HTTPBodyStream); - return _ret.address == 0 - ? null - : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_currentDiskUsage); } /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - set HTTPBodyStream(objc.NSInputStream? value) { + /// @abstract Returns the current amount of space consumed by the + /// in-memory cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the in-memory cache. + /// @result the current usage of the in-memory cache of the receiver. + DartNSUInteger get currentMemoryUsage { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setHTTPBodyStream:', + 'NSURLCache.currentMemoryUsage', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setHTTPBodyStream_, - value?.ref.pointer ?? ffi.nullptr, - ); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_currentMemoryUsage); } /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - bool get HTTPShouldHandleCookies { + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + DartNSUInteger get diskCapacity { objc.checkOsVersionInternal( - 'NSMutableURLRequest.HTTPShouldHandleCookies', + 'NSURLCache.diskCapacity', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_diskCapacity); } - /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - set HTTPShouldHandleCookies(bool value) { + /// init + NSURLCache init() { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setHTTPShouldHandleCookies:', + 'NSURLCache.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSURLCache.fromPointer($ret, retain: false, release: true); + } + + /// ! + /// @method initWithMemoryCapacity:diskCapacity:directoryURL: + /// @abstract Initializes an NSURLCache with the given capacity and directory. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. + /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. + /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. + NSURLCache initWithMemoryCapacity( + DartNSUInteger memoryCapacity, { + required DartNSUInteger diskCapacity, + objc.NSURL? directoryURL, + }) { + objc.checkOsVersionInternal( + 'NSURLCache.initWithMemoryCapacity:diskCapacity:directoryURL:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + final $ret = _objc_msgSend_1dqnse5( + object$.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, + memoryCapacity, + diskCapacity, + directoryURL?.ref.pointer ?? ffi.nullptr, + ); + return NSURLCache.fromPointer($ret, retain: false, release: true); + } + + /// ! + /// @method initWithMemoryCapacity:diskCapacity:diskPath: + /// @abstract Initializes an NSURLCache with the given capacity and + /// path. + /// @discussion The returned NSURLCache is backed by disk, so + /// developers can be more liberal with space when choosing the + /// capacity for this kind of cache. A disk cache measured in the tens + /// of megabytes should be acceptable in most cases. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. + /// @param path the path on disk where the cache data is stored. + /// @result an initialized NSURLCache, with the given capacity, backed + /// by disk. + NSURLCache initWithMemoryCapacity$1( + DartNSUInteger memoryCapacity, { + required DartNSUInteger diskCapacity, + objc.NSString? diskPath, + }) { + objc.checkOsVersionInternal( + 'NSURLCache.initWithMemoryCapacity:diskCapacity:diskPath:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setHTTPShouldHandleCookies_, - value, + final $ret = _objc_msgSend_1dqnse5( + object$.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_diskPath_, + memoryCapacity, + diskCapacity, + diskPath?.ref.pointer ?? ffi.nullptr, ); + return NSURLCache.fromPointer($ret, retain: false, release: true); } /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - bool get HTTPShouldUsePipelining { + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + DartNSUInteger get memoryCapacity { objc.checkOsVersionInternal( - 'NSMutableURLRequest.HTTPShouldUsePipelining', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 7, 0)), + 'NSURLCache.memoryCapacity', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_memoryCapacity); } /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - set HTTPShouldUsePipelining(bool value) { + /// @method removeAllCachedResponses + /// @abstract Clears the given cache, removing all NSCachedURLResponse + /// objects that it stores. + void removeAllCachedResponses() { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setHTTPShouldUsePipelining:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 7, 0)), + 'NSURLCache.removeAllCachedResponses', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setHTTPShouldUsePipelining_, - value, + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_removeAllCachedResponses); + } + + /// ! + /// @method removeCachedResponseForRequest: + /// @abstract Removes the NSCachedURLResponse from the cache that is + /// stored using the given request. + /// @discussion No action is taken if there is no NSCachedURLResponse + /// stored with the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + void removeCachedResponseForRequest(NSURLRequest request) { + objc.checkOsVersionInternal( + 'NSURLCache.removeCachedResponseForRequest:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_removeCachedResponseForRequest_, + request.ref.pointer, + ); + } + + /// ! + /// @method removeCachedResponsesSince: + /// @abstract Clears the given cache of any cached responses since the provided date. + void removeCachedResponsesSinceDate(objc.NSDate date) { + objc.checkOsVersionInternal( + 'NSURLCache.removeCachedResponsesSinceDate:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_removeCachedResponsesSinceDate_, + date.ref.pointer, + ); + } + + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + set diskCapacity(DartNSUInteger value) { + objc.checkOsVersionInternal( + 'NSURLCache.setDiskCapacity:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_1i9r4xy(object$.ref.pointer, _sel_setDiskCapacity_, value); + } + + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + set memoryCapacity(DartNSUInteger value) { + objc.checkOsVersionInternal( + 'NSURLCache.setMemoryCapacity:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_1i9r4xy(object$.ref.pointer, _sel_setMemoryCapacity_, value); + } + + /// ! + /// @method storeCachedResponse:forRequest: + /// @abstract Stores the given NSCachedURLResponse in the cache using + /// the given request. + /// @param cachedResponse The cached response to store. + /// @param request the NSURLRequest to use as a key for the storage. + void storeCachedResponse( + NSCachedURLResponse cachedResponse, { + required NSURLRequest forRequest, + }) { + objc.checkOsVersionInternal( + 'NSURLCache.storeCachedResponse:forRequest:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_storeCachedResponse_forRequest_, + cachedResponse.ref.pointer, + forRequest.ref.pointer, + ); + } +} + +typedef NSNotificationName = ffi.Pointer; +typedef DartNSNotificationName = objc.NSString; +late final _class_NSNotification = objc.getClass("NSNotification"); +late final _sel_notificationWithName_object_ = objc.registerName( + "notificationWithName:object:", +); +final _objc_msgSend_15qeuct = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_notificationWithName_object_userInfo_ = objc.registerName( + "notificationWithName:object:userInfo:", +); +final _objc_msgSend_11spmsz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); + +/// NSNotificationCreation +extension NSNotificationCreation on objc.NSNotification { + /// init + objc.NSNotification init$1() { + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return objc.NSNotification.fromPointer($ret, retain: false, release: true); + } + + /// notificationWithName:object: + static objc.NSNotification notificationWithName( + DartNSNotificationName aName, { + objc.ObjCObject? object, + }) { + final $ret = _objc_msgSend_15qeuct( + _class_NSNotification, + _sel_notificationWithName_object_, + aName.ref.pointer, + object?.ref.pointer ?? ffi.nullptr, + ); + return objc.NSNotification.fromPointer($ret, retain: true, release: true); + } + + /// notificationWithName:object:userInfo: + static objc.NSNotification notificationWithName$1( + DartNSNotificationName aName, { + objc.ObjCObject? object, + objc.NSDictionary? userInfo, + }) { + final $ret = _objc_msgSend_11spmsz( + _class_NSNotification, + _sel_notificationWithName_object_userInfo_, + aName.ref.pointer, + object?.ref.pointer ?? ffi.nullptr, + userInfo?.ref.pointer ?? ffi.nullptr, + ); + return objc.NSNotification.fromPointer($ret, retain: true, release: true); + } +} + +late final _class_NSDate = objc.getClass("NSDate"); +late final _sel_date = objc.registerName("date"); +late final _sel_dateWithTimeIntervalSinceNow_ = objc.registerName( + "dateWithTimeIntervalSinceNow:", +); +final _objc_msgSend_oa8mke = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ) + >(); +late final _sel_dateWithTimeIntervalSinceReferenceDate_ = objc.registerName( + "dateWithTimeIntervalSinceReferenceDate:", +); +late final _sel_dateWithTimeIntervalSince1970_ = objc.registerName( + "dateWithTimeIntervalSince1970:", +); +late final _sel_dateWithTimeInterval_sinceDate_ = objc.registerName( + "dateWithTimeInterval:sinceDate:", +); +final _objc_msgSend_1ozwf6k = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ) + >(); +late final _sel_distantFuture = objc.registerName("distantFuture"); +late final _sel_distantPast = objc.registerName("distantPast"); +late final _sel_now = objc.registerName("now"); +late final _sel_initWithTimeIntervalSinceNow_ = objc.registerName( + "initWithTimeIntervalSinceNow:", +); +late final _sel_initWithTimeIntervalSince1970_ = objc.registerName( + "initWithTimeIntervalSince1970:", +); +late final _sel_initWithTimeInterval_sinceDate_ = objc.registerName( + "initWithTimeInterval:sinceDate:", +); + +/// NSDateCreation +extension NSDateCreation on objc.NSDate { + /// initWithTimeInterval:sinceDate: + objc.NSDate initWithTimeInterval( + DartNSTimeInterval secsToBeAdded, { + required objc.NSDate sinceDate, + }) { + final $ret = _objc_msgSend_1ozwf6k( + object$.ref.retainAndReturnPointer(), + _sel_initWithTimeInterval_sinceDate_, + secsToBeAdded, + sinceDate.ref.pointer, + ); + return objc.NSDate.fromPointer($ret, retain: false, release: true); + } + + /// initWithTimeIntervalSince1970: + objc.NSDate initWithTimeIntervalSince1970(DartNSTimeInterval secs) { + final $ret = _objc_msgSend_oa8mke( + object$.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSince1970_, + secs, + ); + return objc.NSDate.fromPointer($ret, retain: false, release: true); + } + + /// initWithTimeIntervalSinceNow: + objc.NSDate initWithTimeIntervalSinceNow(DartNSTimeInterval secs) { + final $ret = _objc_msgSend_oa8mke( + object$.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSinceNow_, + secs, + ); + return objc.NSDate.fromPointer($ret, retain: false, release: true); + } + + /// date + static objc.NSDate date() { + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_date); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// dateWithTimeInterval:sinceDate: + static objc.NSDate dateWithTimeInterval( + DartNSTimeInterval secsToBeAdded, { + required objc.NSDate sinceDate, + }) { + final $ret = _objc_msgSend_1ozwf6k( + _class_NSDate, + _sel_dateWithTimeInterval_sinceDate_, + secsToBeAdded, + sinceDate.ref.pointer, + ); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// dateWithTimeIntervalSince1970: + static objc.NSDate dateWithTimeIntervalSince1970(DartNSTimeInterval secs) { + final $ret = _objc_msgSend_oa8mke( + _class_NSDate, + _sel_dateWithTimeIntervalSince1970_, + secs, + ); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// dateWithTimeIntervalSinceNow: + static objc.NSDate dateWithTimeIntervalSinceNow(DartNSTimeInterval secs) { + final $ret = _objc_msgSend_oa8mke( + _class_NSDate, + _sel_dateWithTimeIntervalSinceNow_, + secs, + ); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// dateWithTimeIntervalSinceReferenceDate: + static objc.NSDate dateWithTimeIntervalSinceReferenceDate( + DartNSTimeInterval ti, + ) { + final $ret = _objc_msgSend_oa8mke( + _class_NSDate, + _sel_dateWithTimeIntervalSinceReferenceDate_, + ti, + ); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// distantFuture + static objc.NSDate getDistantFuture() { + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantFuture); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// distantPast + static objc.NSDate getDistantPast() { + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantPast); + return objc.NSDate.fromPointer($ret, retain: true, release: true); + } + + /// now + static objc.NSDate getNow() { + objc.checkOsVersionInternal( + 'NSDate.now', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_now); + return objc.NSDate.fromPointer($ret, retain: true, release: true); } } +late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); late final _sel_setURL_ = objc.registerName("setURL:"); late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); final _objc_msgSend_1yjxuv2 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, NSUInteger, ) @@ -48586,7 +48284,7 @@ final _objc_msgSend_1yjxuv2 = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ) @@ -48596,7 +48294,7 @@ final _objc_msgSend_hwm8nu = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Double, ) @@ -48604,7 +48302,7 @@ final _objc_msgSend_hwm8nu = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, double, ) @@ -48617,7 +48315,7 @@ final _objc_msgSend_1mse4s1 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, NSUInteger, ) @@ -48625,7 +48323,7 @@ final _objc_msgSend_1mse4s1 = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ) @@ -48633,6 +48331,23 @@ final _objc_msgSend_1mse4s1 = objc.msgSendPointer late final _sel_setAllowsCellularAccess_ = objc.registerName( "setAllowsCellularAccess:", ); +final _objc_msgSend_1s56lr9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + bool, + ) + >(); late final _sel_setAllowsExpensiveNetworkAccess_ = objc.registerName( "setAllowsExpensiveNetworkAccess:", ); @@ -48647,7 +48362,7 @@ final _objc_msgSend_1nw1jep = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, NSUInteger, ) @@ -48655,7 +48370,7 @@ final _objc_msgSend_1nw1jep = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ) @@ -48669,306 +48384,506 @@ late final _sel_setAllowsPersistentDNS_ = objc.registerName( late final _sel_setCookiePartitionIdentifier_ = objc.registerName( "setCookiePartitionIdentifier:", ); +late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); +late final _sel_setAllHTTPHeaderFields_ = objc.registerName( + "setAllHTTPHeaderFields:", +); +late final _sel_setValue_forHTTPHeaderField_ = objc.registerName( + "setValue:forHTTPHeaderField:", +); +late final _sel_addValue_forHTTPHeaderField_ = objc.registerName( + "addValue:forHTTPHeaderField:", +); +late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); +late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); +late final _sel_setHTTPShouldHandleCookies_ = objc.registerName( + "setHTTPShouldHandleCookies:", +); +late final _sel_setHTTPShouldUsePipelining_ = objc.registerName( + "setHTTPShouldUsePipelining:", +); /// ! -/// @class NSMutableURLRequest -/// -/// @abstract An NSMutableURLRequest object represents a mutable URL load -/// request in a manner independent of protocol and URL scheme. -/// -/// @discussion This specialization of NSURLRequest is provided to aid -/// developers who may find it more convenient to mutate a single request -/// object for a series of URL loads instead of creating an immutable -/// NSURLRequest for each load. This programming model is supported by -/// the following contract stipulation between NSMutableURLRequest and -/// NSURLConnection: NSURLConnection makes a deep copy of each -/// NSMutableURLRequest object passed to one of its initializers. -///

NSMutableURLRequest is designed to be extended to support -/// protocol-specific data by adding categories to access a property -/// object provided in an interface targeted at protocol implementors. -///

    -///
  • Protocol implementors should direct their attention to the -/// NSMutableURLRequestExtensibility category on -/// NSMutableURLRequest for more information on how to provide -/// extensions on NSMutableURLRequest to support protocol-specific -/// request information. -///
  • Clients of this API who wish to create NSMutableURLRequest -/// objects to load URL content should consult the protocol-specific -/// NSMutableURLRequest categories that are available. The -/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an -/// example. -///
-class NSMutableURLRequest extends NSURLRequest { - NSMutableURLRequest._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +/// @category NSMutableURLRequest(NSMutableHTTPURLRequest) +/// The NSMutableHTTPURLRequest on NSMutableURLRequest provides methods +/// for configuring information specific to HTTP protocol requests. +extension NSMutableHTTPURLRequest on NSMutableURLRequest { + /// ! + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + objc.NSData? get HTTPBody { objc.checkOsVersionInternal( - 'NSMutableURLRequest', + 'NSMutableURLRequest.HTTPBody', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - } - - /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. - NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. - NSMutableURLRequest.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSMutableURLRequest]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSMutableURLRequest, - ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_HTTPBody); + return $ret.address == 0 + ? null + : objc.NSData.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract The URL of the receiver. - objc.NSURL? get URL { + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. + objc.NSInputStream? get HTTPBodyStream { objc.checkOsVersionInternal( - 'NSMutableURLRequest.URL', + 'NSMutableURLRequest.HTTPBodyStream', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_HTTPBodyStream, + ); + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSInputStream.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract The URL of the receiver. - set URL(objc.NSURL? value) { + /// @abstract Sets the HTTP request method of the receiver. + objc.NSString get HTTPMethod { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setURL:', + 'NSMutableURLRequest.HTTPMethod', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setURL_, - value?.ref.pointer ?? ffi.nullptr, - ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_HTTPMethod); + return objc.NSString.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract The cache policy of the receiver. - NSURLRequestCachePolicy get cachePolicy { + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored + bool get HTTPShouldHandleCookies { objc.checkOsVersionInternal( - 'NSMutableURLRequest.cachePolicy', + 'NSMutableURLRequest.HTTPShouldHandleCookies', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); - return NSURLRequestCachePolicy.fromValue(_ret); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_HTTPShouldHandleCookies, + ); } /// ! - /// @abstract The cache policy of the receiver. - set cachePolicy(NSURLRequestCachePolicy value) { + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). + bool get HTTPShouldUsePipelining { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setCachePolicy:', + 'NSMutableURLRequest.HTTPShouldUsePipelining', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_HTTPShouldUsePipelining, + ); + } + + /// ! + /// @method addValue:forHTTPHeaderField: + /// @abstract Adds an HTTP header field in the current header + /// dictionary. + /// @discussion This method provides a way to add values to header + /// fields incrementally. If a value was previously set for the given + /// header field, the given value is appended to the previously-existing + /// value. The appropriate field delimiter, a comma in the case of HTTP, + /// is added by the implementation, and should not be added to the given + /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP + /// header field names are case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void addValue( + objc.NSString value, { + required objc.NSString forHTTPHeaderField, + }) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.addValue:forHTTPHeaderField:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1yjxuv2(this.ref.pointer, _sel_setCachePolicy_, value.value); + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_addValue_forHTTPHeaderField_, + value.ref.pointer, + forHTTPHeaderField.ref.pointer, + ); } /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - DartNSTimeInterval get timeoutInterval { + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. + objc.NSDictionary? get allHTTPHeaderFields { objc.checkOsVersionInternal( - 'NSMutableURLRequest.timeoutInterval', + 'NSMutableURLRequest.allHTTPHeaderFields', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_allHTTPHeaderFields, + ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - set timeoutInterval(DartNSTimeInterval value) { + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. + set allHTTPHeaderFields(objc.NSDictionary? value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setTimeoutInterval:', + 'NSMutableURLRequest.setAllHTTPHeaderFields:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - _objc_msgSend_hwm8nu(this.ref.pointer, _sel_setTimeoutInterval_, value); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setAllHTTPHeaderFields_, + value?.ref.pointer ?? ffi.nullptr, + ); } /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - objc.NSURL? get mainDocumentURL { + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + set HTTPBody(objc.NSData? value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.mainDocumentURL', + 'NSMutableURLRequest.setHTTPBody:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_mainDocumentURL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setHTTPBody_, + value?.ref.pointer ?? ffi.nullptr, + ); } /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - set mainDocumentURL(objc.NSURL? value) { + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. + set HTTPBodyStream(objc.NSInputStream? value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setMainDocumentURL:', + 'NSMutableURLRequest.setHTTPBodyStream:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setMainDocumentURL_, + object$.ref.pointer, + _sel_setHTTPBodyStream_, value?.ref.pointer ?? ffi.nullptr, ); } /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - NSURLRequestNetworkServiceType get networkServiceType { + /// @abstract Sets the HTTP request method of the receiver. + set HTTPMethod(objc.NSString value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.networkServiceType', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 7, 0)), + 'NSMutableURLRequest.setHTTPMethod:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_t4uaw1( - this.ref.pointer, - _sel_networkServiceType, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setHTTPMethod_, + value.ref.pointer, ); - return NSURLRequestNetworkServiceType.fromValue(_ret); } /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - set networkServiceType(NSURLRequestNetworkServiceType value) { + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored + set HTTPShouldHandleCookies(bool value) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setNetworkServiceType:', + 'NSMutableURLRequest.setHTTPShouldHandleCookies:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setHTTPShouldHandleCookies_, + value, + ); + } + + /// ! + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). + set HTTPShouldUsePipelining(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setHTTPShouldUsePipelining:', iOS: (false, (4, 0, 0)), macOS: (false, (10, 7, 0)), ); - _objc_msgSend_1mse4s1( - this.ref.pointer, - _sel_setNetworkServiceType_, - value.value, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setHTTPShouldUsePipelining_, + value, ); } /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - bool get allowsCellularAccess { + /// @method setValue:forHTTPHeaderField: + /// @abstract Sets the value of the given HTTP header field. + /// @discussion If a value was previously set for the given header + /// field, that value is replaced with the given value. Note that, in + /// keeping with the HTTP RFC, HTTP header field names are + /// case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void setValue( + objc.NSString? value, { + required objc.NSString forHTTPHeaderField, + }) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.allowsCellularAccess', - iOS: (false, (6, 0, 0)), - macOS: (false, (10, 8, 0)), + 'NSMutableURLRequest.setValue:forHTTPHeaderField:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_setValue_forHTTPHeaderField_, + value?.ref.pointer ?? ffi.nullptr, + forHTTPHeaderField.ref.pointer, + ); + } +} + +/// ! +/// @class NSMutableURLRequest +/// +/// @abstract An NSMutableURLRequest object represents a mutable URL load +/// request in a manner independent of protocol and URL scheme. +/// +/// @discussion This specialization of NSURLRequest is provided to aid +/// developers who may find it more convenient to mutate a single request +/// object for a series of URL loads instead of creating an immutable +/// NSURLRequest for each load. This programming model is supported by +/// the following contract stipulation between NSMutableURLRequest and +/// NSURLConnection: NSURLConnection makes a deep copy of each +/// NSMutableURLRequest object passed to one of its initializers. +///

NSMutableURLRequest is designed to be extended to support +/// protocol-specific data by adding categories to access a property +/// object provided in an interface targeted at protocol implementors. +///

    +///
  • Protocol implementors should direct their attention to the +/// NSMutableURLRequestExtensibility category on +/// NSMutableURLRequest for more information on how to provide +/// extensions on NSMutableURLRequest to support protocol-specific +/// request information. +///
  • Clients of this API who wish to create NSMutableURLRequest +/// objects to load URL content should consult the protocol-specific +/// NSMutableURLRequest categories that are available. The +/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an +/// example. +///
+extension type NSMutableURLRequest._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLRequest { + /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. + NSMutableURLRequest.as(objc.ObjCObject other) : object$ = other { + objc.checkOsVersionInternal( + 'NSMutableURLRequest', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + assert(isA(object$)); + } + + /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. + NSMutableURLRequest.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSMutableURLRequest, + ); + + /// alloc + static NSMutableURLRequest alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSMutableURLRequest, _sel_alloc); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSMutableURLRequest allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( + _class_NSMutableURLRequest, + _sel_allocWithZone_, + zone, ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); + } + + /// new + static NSMutableURLRequest new$() { + final $ret = _objc_msgSend_151sglz(_class_NSMutableURLRequest, _sel_new); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); } /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - set allowsCellularAccess(bool value) { + /// @method requestWithURL: + /// @abstract Allocates and initializes an NSURLRequest with the given + /// URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL(objc.NSURL URL) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAllowsCellularAccess:', - iOS: (false, (6, 0, 0)), - macOS: (false, (10, 8, 0)), + 'NSMutableURLRequest.requestWithURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAllowsCellularAccess_, - value, + final $ret = _objc_msgSend_1sotr3r( + _class_NSMutableURLRequest, + _sel_requestWithURL_, + URL.ref.pointer, ); + return NSMutableURLRequest.fromPointer($ret, retain: true, release: true); } /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - bool get allowsExpensiveNetworkAccess { + /// @method requestWithURL:cachePolicy:timeoutInterval: + /// @abstract Allocates and initializes a NSURLRequest with the given + /// URL and cache policy. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL$1( + objc.NSURL URL, { + required NSURLRequestCachePolicy cachePolicy, + required DartNSTimeInterval timeoutInterval, + }) { objc.checkOsVersionInternal( - 'NSMutableURLRequest.allowsExpensiveNetworkAccess', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSMutableURLRequest.requestWithURL:cachePolicy:timeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_1ajs603( + _class_NSMutableURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval, ); + return NSMutableURLRequest.fromPointer($ret, retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { return _objc_msgSend_91o635( - this.ref.pointer, - _sel_allowsExpensiveNetworkAccess, + _class_NSMutableURLRequest, + _sel_supportsSecureCoding, ); } + /// Returns a new instance of NSMutableURLRequest constructed with the default `new` method. + NSMutableURLRequest() : this.as(new$().object$); +} + +extension NSMutableURLRequest$Methods on NSMutableURLRequest { /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - set allowsExpensiveNetworkAccess(bool value) { + /// @abstract The URL of the receiver. + objc.NSURL? get URL { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAllowsExpensiveNetworkAccess:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSMutableURLRequest.URL', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAllowsExpensiveNetworkAccess_, - value, + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_URL); + return $ret.address == 0 + ? null + : objc.NSURL.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + bool get allowsCellularAccess { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.allowsCellularAccess', + iOS: (false, (6, 0, 0)), + macOS: (false, (10, 8, 0)), ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_allowsCellularAccess); } /// ! @@ -48983,41 +48898,41 @@ class NSMutableURLRequest extends NSURLRequest { macOS: (false, (10, 15, 0)), ); return _objc_msgSend_91o635( - this.ref.pointer, + object$.ref.pointer, _sel_allowsConstrainedNetworkAccess, ); } /// ! /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to /// satisfy the request, YES otherwise. - set allowsConstrainedNetworkAccess(bool value) { + bool get allowsExpensiveNetworkAccess { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAllowsConstrainedNetworkAccess:', + 'NSMutableURLRequest.allowsExpensiveNetworkAccess', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAllowsConstrainedNetworkAccess_, - value, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_allowsExpensiveNetworkAccess, ); } /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - bool get assumesHTTP3Capable { + /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, + /// in a persistent per-process cache. This should only be set for hostnames whose resolutions + /// are not expected to change across networks. + /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, + /// NO otherwise. Defaults to NO. + bool get allowsPersistentDNS { objc.checkOsVersionInternal( - 'NSMutableURLRequest.assumesHTTP3Capable', - iOS: (false, (14, 5, 0)), - macOS: (false, (11, 3, 0)), + 'NSMutableURLRequest.allowsPersistentDNS', + iOS: (false, (18, 0, 0)), + macOS: (false, (15, 0, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_allowsPersistentDNS); } /// ! @@ -49025,17 +48940,13 @@ class NSMutableURLRequest extends NSURLRequest { /// racing without HTTP/3 service discovery. /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. - set assumesHTTP3Capable(bool value) { + bool get assumesHTTP3Capable { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAssumesHTTP3Capable:', + 'NSMutableURLRequest.assumesHTTP3Capable', iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAssumesHTTP3Capable_, - value, - ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_assumesHTTP3Capable); } /// ! @@ -49048,187 +48959,62 @@ class NSMutableURLRequest extends NSURLRequest { iOS: (false, (15, 0, 0)), macOS: (false, (12, 0, 0)), ); - final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); - return NSURLRequestAttribution.fromValue(_ret); + final $ret = _objc_msgSend_i3avs9(object$.ref.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue($ret); } /// ! - /// @abstract Sets the NSURLRequestAttribution to associate with this request. - /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the - /// user. Defaults to NSURLRequestAttributionDeveloper. - set attribution(NSURLRequestAttribution value) { + /// @abstract The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAttribution:', - iOS: (false, (15, 0, 0)), - macOS: (false, (12, 0, 0)), + 'NSMutableURLRequest.cachePolicy', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - _objc_msgSend_1nw1jep(this.ref.pointer, _sel_setAttribution_, value.value); + final $ret = _objc_msgSend_8jm3uo(object$.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue($ret); } - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - bool get requiresDNSSECValidation { + /// Cookie partition identifier used for cookie storage and retrieval. + objc.NSString? get cookiePartitionIdentifier { objc.checkOsVersionInternal( - 'NSMutableURLRequest.requiresDNSSECValidation', - iOS: (false, (16, 1, 0)), - macOS: (false, (13, 0, 0)), + 'NSMutableURLRequest.cookiePartitionIdentifier', + iOS: (false, (18, 2, 0)), + macOS: (false, (15, 2, 0)), ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_requiresDNSSECValidation, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_cookiePartitionIdentifier, ); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - set requiresDNSSECValidation(bool value) { + /// init + NSMutableURLRequest init() { objc.checkOsVersionInternal( - 'NSMutableURLRequest.setRequiresDNSSECValidation:', - iOS: (false, (16, 1, 0)), - macOS: (false, (13, 0, 0)), + 'NSMutableURLRequest.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setRequiresDNSSECValidation_, - value, + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); } - /// ! - /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, - /// in a persistent per-process cache. This should only be set for hostnames whose resolutions - /// are not expected to change across networks. - /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, - /// NO otherwise. Defaults to NO. - bool get allowsPersistentDNS { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.allowsPersistentDNS', - iOS: (false, (18, 0, 0)), - macOS: (false, (15, 0, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsPersistentDNS); - } - - /// ! - /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, - /// in a persistent per-process cache. This should only be set for hostnames whose resolutions - /// are not expected to change across networks. - /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, - /// NO otherwise. Defaults to NO. - set allowsPersistentDNS(bool value) { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.setAllowsPersistentDNS:', - iOS: (false, (18, 0, 0)), - macOS: (false, (15, 0, 0)), - ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAllowsPersistentDNS_, - value, - ); - } - - /// Cookie partition identifier used for cookie storage and retrieval. - objc.NSString? get cookiePartitionIdentifier { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.cookiePartitionIdentifier', - iOS: (false, (18, 2, 0)), - macOS: (false, (15, 2, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_cookiePartitionIdentifier, - ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// Cookie partition identifier used for cookie storage and retrieval. - set cookiePartitionIdentifier(objc.NSString? value) { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.setCookiePartitionIdentifier:', - iOS: (false, (18, 2, 0)), - macOS: (false, (15, 2, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setCookiePartitionIdentifier_, - value?.ref.pointer ?? ffi.nullptr, - ); - } - - /// ! - /// @method requestWithURL: - /// @abstract Allocates and initializes an NSURLRequest with the given - /// URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL(objc.NSURL URL) { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.requestWithURL:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSMutableURLRequest, - _sel_requestWithURL_, - URL.ref.pointer, - ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSMutableURLRequest, - _sel_supportsSecureCoding, - ); - } - - /// ! - /// @method requestWithURL:cachePolicy:timeoutInterval: - /// @abstract Allocates and initializes a NSURLRequest with the given - /// URL and cache policy. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL$1( - objc.NSURL URL, { - required NSURLRequestCachePolicy cachePolicy, - required DartNSTimeInterval timeoutInterval, - }) { - objc.checkOsVersionInternal( - 'NSMutableURLRequest.requestWithURL:cachePolicy:timeoutInterval:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_1ajs603( - _class_NSMutableURLRequest, - _sel_requestWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval, - ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: true, - release: true, + /// initWithCoder: + NSMutableURLRequest? initWithCoder(objc.NSCoder coder) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithCoder_, + coder.ref.pointer, ); + return $ret.address == 0 + ? null + : NSMutableURLRequest.fromPointer($ret, retain: false, release: true); } /// ! @@ -49245,16 +49031,12 @@ class NSMutableURLRequest extends NSURLRequest { iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer, ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, - ); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); } /// ! @@ -49279,120 +49061,324 @@ class NSMutableURLRequest extends NSURLRequest { iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_1ajs603( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1ajs603( + object$.ref.retainAndReturnPointer(), _sel_initWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, cachePolicy.value, timeoutInterval, ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, - ); + return NSMutableURLRequest.fromPointer($ret, retain: false, release: true); } - /// init - NSMutableURLRequest init() { + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + objc.NSURL? get mainDocumentURL { objc.checkOsVersionInternal( - 'NSMutableURLRequest.init', + 'NSMutableURLRequest.mainDocumentURL', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), + macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_mainDocumentURL, ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, + return $ret.address == 0 + ? null + : objc.NSURL.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + NSURLRequestNetworkServiceType get networkServiceType { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.networkServiceType', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0)), + ); + final $ret = _objc_msgSend_t4uaw1( + object$.ref.pointer, + _sel_networkServiceType, ); + return NSURLRequestNetworkServiceType.fromValue($ret); } - /// new - static NSMutableURLRequest new$() { - final _ret = _objc_msgSend_151sglz(_class_NSMutableURLRequest, _sel_new); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + bool get requiresDNSSECValidation { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.requiresDNSSECValidation', + iOS: (false, (16, 1, 0)), + macOS: (false, (13, 0, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_requiresDNSSECValidation, ); } - /// allocWithZone: - static NSMutableURLRequest allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSMutableURLRequest, - _sel_allocWithZone_, - zone, + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + set allowsCellularAccess$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsCellularAccess:', + iOS: (false, (6, 0, 0)), + macOS: (false, (10, 8, 0)), ); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAllowsCellularAccess_, + value, ); } - /// alloc - static NSMutableURLRequest alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSMutableURLRequest, _sel_alloc); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// satisfy the request, YES otherwise. + set allowsConstrainedNetworkAccess$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsConstrainedNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAllowsConstrainedNetworkAccess_, + value, ); } - /// self - NSMutableURLRequest self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: true, - release: true, + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. + set allowsExpensiveNetworkAccess$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsExpensiveNetworkAccess:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAllowsExpensiveNetworkAccess_, + value, ); } - /// retain - NSMutableURLRequest retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: true, - release: true, + /// ! + /// @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, + /// in a persistent per-process cache. This should only be set for hostnames whose resolutions + /// are not expected to change across networks. + /// @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, + /// NO otherwise. Defaults to NO. + set allowsPersistentDNS$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAllowsPersistentDNS:', + iOS: (false, (18, 0, 0)), + macOS: (false, (15, 0, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAllowsPersistentDNS_, + value, ); } - /// autorelease - NSMutableURLRequest autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSMutableURLRequest.castFromPointer( - _ret, - retain: true, - release: true, + /// ! + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + set assumesHTTP3Capable$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAssumesHTTP3Capable:', + iOS: (false, (14, 5, 0)), + macOS: (false, (11, 3, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAssumesHTTP3Capable_, + value, ); } - /// initWithCoder: - NSMutableURLRequest? initWithCoder(objc.NSCoder coder) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, - coder.ref.pointer, + /// ! + /// @abstract Sets the NSURLRequestAttribution to associate with this request. + /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the + /// user. Defaults to NSURLRequestAttributionDeveloper. + set attribution$1(NSURLRequestAttribution value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setAttribution:', + iOS: (false, (15, 0, 0)), + macOS: (false, (12, 0, 0)), + ); + _objc_msgSend_1nw1jep( + object$.ref.pointer, + _sel_setAttribution_, + value.value, ); - return _ret.address == 0 - ? null - : NSMutableURLRequest.castFromPointer( - _ret, - retain: false, - release: true, - ); } - /// Returns a new instance of NSMutableURLRequest constructed with the default `new` method. - factory NSMutableURLRequest() => new$(); + /// ! + /// @abstract The cache policy of the receiver. + set cachePolicy$1(NSURLRequestCachePolicy value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setCachePolicy:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_1yjxuv2( + object$.ref.pointer, + _sel_setCachePolicy_, + value.value, + ); + } + + /// Cookie partition identifier used for cookie storage and retrieval. + set cookiePartitionIdentifier$1(objc.NSString? value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setCookiePartitionIdentifier:', + iOS: (false, (18, 2, 0)), + macOS: (false, (15, 2, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setCookiePartitionIdentifier_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + set mainDocumentURL$1(objc.NSURL? value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setMainDocumentURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setMainDocumentURL_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + set networkServiceType$1(NSURLRequestNetworkServiceType value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setNetworkServiceType:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 7, 0)), + ); + _objc_msgSend_1mse4s1( + object$.ref.pointer, + _sel_setNetworkServiceType_, + value.value, + ); + } + + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + set requiresDNSSECValidation$1(bool value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setRequiresDNSSECValidation:', + iOS: (false, (16, 1, 0)), + macOS: (false, (13, 0, 0)), + ); + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setRequiresDNSSECValidation_, + value, + ); + } + + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + set timeoutInterval$1(DartNSTimeInterval value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setTimeoutInterval:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_hwm8nu(object$.ref.pointer, _sel_setTimeoutInterval_, value); + } + + /// ! + /// @abstract The URL of the receiver. + set URL$1(objc.NSURL? value) { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.setURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setURL_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + DartNSTimeInterval get timeoutInterval { + objc.checkOsVersionInternal( + 'NSMutableURLRequest.timeoutInterval', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_timeoutInterval) + : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_timeoutInterval); + } } enum NSHTTPCookieAcceptPolicy { @@ -49417,12 +49403,10 @@ enum NSHTTPCookieAcceptPolicy { /// NSHTTPCookieStorage in your config's objc-interfaces list. /// /// NSHTTPCookieStorage -class NSHTTPCookieStorage extends objc.NSObject { - NSHTTPCookieStorage._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +extension type NSHTTPCookieStorage._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + NSHTTPCookieStorage.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSHTTPCookieStorage', iOS: (false, (2, 0, 0)), @@ -49430,45 +49414,22 @@ class NSHTTPCookieStorage extends objc.NSObject { ); } - /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. - NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSHTTPCookieStorage] that wraps the given raw object pointer. - NSHTTPCookieStorage.castFromPointer( - ffi.Pointer other, { + NSHTTPCookieStorage.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSHTTPCookieStorage', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + } } late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); - -/// WARNING: NSProgressReporting is a stub. To generate bindings for this class, include -/// NSProgressReporting in your config's objc-protocols list. -/// -/// NSProgressReporting -interface class NSProgressReporting extends objc.ObjCProtocolBase - implements objc.NSObjectProtocol { - NSProgressReporting._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - - /// Constructs a [NSProgressReporting] that points to the same underlying object as [other]. - NSProgressReporting.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSProgressReporting] that wraps the given raw object pointer. - NSProgressReporting.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); late final _sel_originalRequest = objc.registerName("originalRequest"); late final _sel_currentRequest = objc.registerName("currentRequest"); @@ -49480,24 +49441,24 @@ late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = final _objc_msgSend_l9ppnx = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Long, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ) >(); late final _sel_MIMEType = objc.registerName("MIMEType"); @@ -49508,92 +49469,83 @@ final _objc_msgSend_1k101e3 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.LongLong Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_textEncodingName = objc.registerName("textEncodingName"); late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); /// NSURLResponse -class NSURLResponse extends objc.NSObject - implements objc.NSSecureCoding, objc.NSCopying { - NSURLResponse._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - +extension type NSURLResponse._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSSecureCoding, + objc.NSCopying { /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. - NSURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLResponse.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } /// Constructs a [NSURLResponse] that wraps the given raw object pointer. - NSURLResponse.castFromPointer( - ffi.Pointer other, { + NSURLResponse.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } /// Returns whether [obj] is an instance of [NSURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLResponse, + ); + + /// alloc + static NSURLResponse alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSURLResponse, _sel_alloc); + return NSURLResponse.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLResponse allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( _class_NSURLResponse, + _sel_allocWithZone_, + zone, ); + return NSURLResponse.fromPointer($ret, retain: false, release: true); } - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSURLResponse initWithUrlAndMIMEType( - objc.NSURL URL, { - objc.NSString? MIMEType, - required DartNSInteger length, - objc.NSString? name, - }) { - objc.checkOsVersionInternal( - 'NSURLResponse.initWithURL:MIMEType:expectedContentLength:textEncodingName:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_l9ppnx( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, - URL.ref.pointer, - MIMEType?.ref.pointer ?? ffi.nullptr, - length, - name?.ref.pointer ?? ffi.nullptr, - ); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// new + static NSURLResponse new$() { + final $ret = _objc_msgSend_151sglz(_class_NSURLResponse, _sel_new); + return NSURLResponse.fromPointer($ret, retain: false, release: true); } - /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - objc.NSURL? get URL { - objc.checkOsVersionInternal( - 'NSURLResponse.URL', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSURLResponse, + _sel_supportsSecureCoding, ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } + /// Returns a new instance of NSURLResponse constructed with the default `new` method. + NSURLResponse() : this.as(new$().object$); +} + +extension NSURLResponse$Methods on NSURLResponse { /// ! /// @abstract Returns the MIME type of the receiver. /// @discussion The MIME type is based on the information provided @@ -49609,10 +49561,34 @@ class NSURLResponse extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_MIMEType); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_MIMEType); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + objc.checkOsVersionInternal( + 'NSURLResponse.URL', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_URL); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); + } + + /// encodeWithCoder: + void encodeWithCoder(objc.NSCoder coder) { + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_encodeWithCoder_, + coder.ref.pointer, + ); } /// ! @@ -49632,31 +49608,70 @@ class NSURLResponse extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - return _objc_msgSend_1k101e3(this.ref.pointer, _sel_expectedContentLength); + return _objc_msgSend_1k101e3( + object$.ref.pointer, + _sel_expectedContentLength, + ); } - /// ! - /// @abstract Returns the name of the text encoding of the receiver. - /// @discussion This name will be the actual string reported by the - /// origin source during the course of performing a protocol-specific - /// URL load. Clients can inspect this string and convert it to an - /// NSStringEncoding or CFStringEncoding using the methods and - /// functions made available in the appropriate framework. - /// @result The name of the text encoding of the receiver, or nil if no - /// text encoding was specified. - objc.NSString? get textEncodingName { + /// init + NSURLResponse init() { objc.checkOsVersionInternal( - 'NSURLResponse.textEncodingName', + 'NSURLResponse.init', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_textEncodingName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSURLResponse.fromPointer($ret, retain: false, release: true); } - /// ! + /// initWithCoder: + NSURLResponse? initWithCoder(objc.NSCoder coder) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithCoder_, + coder.ref.pointer, + ); + return $ret.address == 0 + ? null + : NSURLResponse.fromPointer($ret, retain: false, release: true); + } + + /// ! + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSURLResponse initWithUrlAndMIMEType( + objc.NSURL URL, { + objc.NSString? MIMEType, + required DartNSInteger length, + objc.NSString? name, + }) { + objc.checkOsVersionInternal( + 'NSURLResponse.initWithURL:MIMEType:expectedContentLength:textEncodingName:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), + ); + final $ret = _objc_msgSend_l9ppnx( + object$.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr, + ); + return NSURLResponse.fromPointer($ret, retain: false, release: true); + } + + /// ! /// @abstract Returns a suggested filename if the resource were saved to disk. /// @discussion The method first checks if the server has specified a filename using the /// content disposition header. If no valid filename is specified using that mechanism, @@ -49672,100 +49687,38 @@ class NSURLResponse extends objc.NSObject iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_suggestedFilename, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// init - NSURLResponse init() { + /// ! + /// @abstract Returns the name of the text encoding of the receiver. + /// @discussion This name will be the actual string reported by the + /// origin source during the course of performing a protocol-specific + /// URL load. Clients can inspect this string and convert it to an + /// NSStringEncoding or CFStringEncoding using the methods and + /// functions made available in the appropriate framework. + /// @result The name of the text encoding of the receiver, or nil if no + /// text encoding was specified. + objc.NSString? get textEncodingName { objc.checkOsVersionInternal( - 'NSURLResponse.init', + 'NSURLResponse.textEncodingName', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLResponse new$() { - final _ret = _objc_msgSend_151sglz(_class_NSURLResponse, _sel_new); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSURLResponse allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLResponse, - _sel_allocWithZone_, - zone, - ); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSURLResponse alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSURLResponse, _sel_alloc); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSURLResponse self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSURLResponse retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSURLResponse autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSURLResponse, - _sel_supportsSecureCoding, - ); - } - - /// encodeWithCoder: - void encodeWithCoder(objc.NSCoder coder) { - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_encodeWithCoder_, - coder.ref.pointer, + macOS: (false, (10, 2, 0)), ); - } - - /// initWithCoder: - NSURLResponse? initWithCoder(objc.NSCoder coder) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, - coder.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_textEncodingName, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : NSURLResponse.castFromPointer(_ret, retain: false, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - - /// Returns a new instance of NSURLResponse constructed with the default `new` method. - factory NSURLResponse() => new$(); } late final _sel_response = objc.registerName("response"); @@ -49774,69 +49727,28 @@ late final _sel_response = objc.registerName("response"); /// NSURLSessionTaskDelegate in your config's objc-protocols list. /// /// Messages related to the operation of a specific task. -interface class NSURLSessionTaskDelegate extends objc.ObjCProtocolBase - implements NSURLSessionDelegate { - NSURLSessionTaskDelegate._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSURLSessionTaskDelegate._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, NSURLSessionDelegate { /// Constructs a [NSURLSessionTaskDelegate] that points to the same underlying object as [other]. - NSURLSessionTaskDelegate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLSessionTaskDelegate.as(objc.ObjCObject other) : object$ = other; /// Constructs a [NSURLSessionTaskDelegate] that wraps the given raw object pointer. - NSURLSessionTaskDelegate.castFromPointer( - ffi.Pointer other, { + NSURLSessionTaskDelegate.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } late final _sel_delegate = objc.registerName("delegate"); late final _sel_setDelegate_ = objc.registerName("setDelegate:"); late final _sel_progress = objc.registerName("progress"); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgress_ffiVoid_closureTrampoline) - .cast(); /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_NSProgress_ffiVoid { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -49855,15 +49767,12 @@ abstract final class ObjCBlock_NSProgress_ffiVoid { fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) + ffi.Pointer Function(ffi.Pointer arg0) > > ptr, ) => objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -49882,31 +49791,68 @@ abstract final class ObjCBlock_NSProgress_ffiVoid { bool keepIsolateAlive = true, }) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_closureCallable, + _closureCallable, (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), keepIsolateAlive, ), retain: false, release: true, ); + + static ffi.Pointer _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0) + > + >() + .asFunction< + ffi.Pointer Function(ffi.Pointer) + >()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static ffi.Pointer _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as ffi.Pointer Function(ffi.Pointer))( + arg0, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_CallExtension +extension ObjCBlock_NSProgress_ffiVoid$CallExtension on objc.ObjCBlock)> { objc.NSProgress call(ffi.Pointer arg0) => - objc.NSProgress.castFromPointer( + objc.NSProgress.fromPointer( ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer block, ffi.Pointer arg0, ) > >() .asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ) @@ -49927,13 +49873,16 @@ final _objc_msgSend_pysgoz = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Int64 Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_setCountOfBytesClientExpectsToSend_ = objc.registerName( "setCountOfBytesClientExpectsToSend:", @@ -49942,7 +49891,7 @@ final _objc_msgSend_17gvxvj = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Int64, ) @@ -49950,7 +49899,7 @@ final _objc_msgSend_17gvxvj = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ) @@ -50003,13 +49952,16 @@ final _objc_msgSend_1vze0g9 = objc.msgSendPointer .cast< ffi.NativeFunction< NSInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); late final _sel_error = objc.registerName("error"); late final _sel_suspend = objc.registerName("suspend"); @@ -50019,14 +49971,14 @@ final _objc_msgSend_2cgrxl = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Float Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -50034,14 +49986,14 @@ final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer .cast< ffi.NativeFunction< ffi.Float Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< double Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -50050,7 +50002,7 @@ final _objc_msgSend_v5hmet = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Float, ) @@ -50058,7 +50010,7 @@ final _objc_msgSend_v5hmet = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, double, ) @@ -50070,175 +50022,113 @@ late final _sel_setPrefersIncrementalDelivery_ = objc.registerName( "setPrefersIncrementalDelivery:", ); -/// NSURLSessionTask - a cancelable object that refers to the lifetime -/// of processing a given request. -class NSURLSessionTask extends objc.NSObject - implements objc.NSCopying, NSProgressReporting { - NSURLSessionTask._( - ffi.Pointer pointer, { +/// WARNING: NSProgressReporting is a stub. To generate bindings for this class, include +/// NSProgressReporting in your config's objc-protocols list. +/// +/// NSProgressReporting +extension type NSProgressReporting._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, objc.NSObjectProtocol { + /// Constructs a [NSProgressReporting] that points to the same underlying object as [other]. + NSProgressReporting.as(objc.ObjCObject other) : object$ = other; + + /// Constructs a [NSProgressReporting] that wraps the given raw object pointer. + NSProgressReporting.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); +} + +/// NSURLSessionTask - a cancelable object that refers to the lifetime +/// of processing a given request. +extension type NSURLSessionTask._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSCopying, + NSProgressReporting { + /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. + NSURLSessionTask.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSURLSessionTask', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); + assert(isA(object$)); } - /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. - NSURLSessionTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. - NSURLSessionTask.castFromPointer( - ffi.Pointer other, { + NSURLSessionTask.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLSessionTask, - ); - } - - /// an identifier for this task, assigned by and unique to the owning session - DartNSUInteger get taskIdentifier { - objc.checkOsVersionInternal( - 'NSURLSessionTask.taskIdentifier', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_taskIdentifier); - } - - /// may be nil if this is a stream task - NSURLRequest? get originalRequest { + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSURLSessionTask.originalRequest', + 'NSURLSessionTask', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_originalRequest); - return _ret.address == 0 - ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + assert(isA(object$)); } - /// may differ from originalRequest due to http server redirection - NSURLRequest? get currentRequest { - objc.checkOsVersionInternal( - 'NSURLSessionTask.currentRequest', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_currentRequest); - return _ret.address == 0 - ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSessionTask, + ); - /// may be nil if no response has been received - NSURLResponse? get response { - objc.checkOsVersionInternal( - 'NSURLSessionTask.response', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_response); - return _ret.address == 0 - ? null - : NSURLResponse.castFromPointer(_ret, retain: true, release: true); + /// alloc + static NSURLSessionTask alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSURLSessionTask, _sel_alloc); + return NSURLSessionTask.fromPointer($ret, retain: false, release: true); } - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - NSURLSessionTaskDelegate? get delegate { - objc.checkOsVersionInternal( - 'NSURLSessionTask.delegate', - iOS: (false, (15, 0, 0)), - macOS: (false, (12, 0, 0)), + /// allocWithZone: + static NSURLSessionTask allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLSessionTask, + _sel_allocWithZone_, + zone, ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : NSURLSessionTaskDelegate.castFromPointer( - _ret, - retain: true, - release: true, - ); + return NSURLSessionTask.fromPointer($ret, retain: false, release: true); } - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - set delegate(NSURLSessionTaskDelegate? value) { - objc.checkOsVersionInternal( - 'NSURLSessionTask.setDelegate:', - iOS: (false, (15, 0, 0)), - macOS: (false, (12, 0, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setDelegate_, - value?.ref.pointer ?? ffi.nullptr, - ); + /// new + static NSURLSessionTask new$() { + final $ret = _objc_msgSend_151sglz(_class_NSURLSessionTask, _sel_new); + return NSURLSessionTask.fromPointer($ret, retain: false, release: true); } - /// progress - objc.NSProgress get progress { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_progress); - return objc.NSProgress.castFromPointer(_ret, retain: true, release: true); - } + /// Returns a new instance of NSURLSessionTask constructed with the default `new` method. + NSURLSessionTask() : this.as(new$().object$); +} - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - objc.NSDate? get earliestBeginDate { +extension NSURLSessionTask$Methods on NSURLSessionTask { + /// -cancel returns immediately, but marks a task as being canceled. + /// The task will signal -URLSession:task:didCompleteWithError: with an + /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some + /// cases, the task may signal other work before it acknowledges the + /// cancelation. -cancel may be sent to a task that has been suspended. + void cancel() { objc.checkOsVersionInternal( - 'NSURLSessionTask.earliestBeginDate', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_earliestBeginDate, + 'NSURLSessionTask.cancel', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_cancel); } - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - set earliestBeginDate(objc.NSDate? value) { + /// countOfBytesClientExpectsToReceive + int get countOfBytesClientExpectsToReceive { objc.checkOsVersionInternal( - 'NSURLSessionTask.setEarliestBeginDate:', + 'NSURLSessionTask.countOfBytesClientExpectsToReceive', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setEarliestBeginDate_, - value?.ref.pointer ?? ffi.nullptr, + return _objc_msgSend_pysgoz( + object$.ref.pointer, + _sel_countOfBytesClientExpectsToReceive, ); } @@ -50252,72 +50142,22 @@ class NSURLSessionTask extends objc.NSObject macOS: (false, (10, 13, 0)), ); return _objc_msgSend_pysgoz( - this.ref.pointer, + object$.ref.pointer, _sel_countOfBytesClientExpectsToSend, ); } - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - set countOfBytesClientExpectsToSend(int value) { - objc.checkOsVersionInternal( - 'NSURLSessionTask.setCountOfBytesClientExpectsToSend:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - _objc_msgSend_17gvxvj( - this.ref.pointer, - _sel_setCountOfBytesClientExpectsToSend_, - value, - ); - } - - /// countOfBytesClientExpectsToReceive - int get countOfBytesClientExpectsToReceive { - objc.checkOsVersionInternal( - 'NSURLSessionTask.countOfBytesClientExpectsToReceive', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - return _objc_msgSend_pysgoz( - this.ref.pointer, - _sel_countOfBytesClientExpectsToReceive, - ); - } - - /// setCountOfBytesClientExpectsToReceive: - set countOfBytesClientExpectsToReceive(int value) { - objc.checkOsVersionInternal( - 'NSURLSessionTask.setCountOfBytesClientExpectsToReceive:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - _objc_msgSend_17gvxvj( - this.ref.pointer, - _sel_setCountOfBytesClientExpectsToReceive_, - value, - ); - } - - /// number of body bytes already sent - int get countOfBytesSent { + /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. + int get countOfBytesExpectedToReceive { objc.checkOsVersionInternal( - 'NSURLSessionTask.countOfBytesSent', + 'NSURLSessionTask.countOfBytesExpectedToReceive', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesSent); - } - - /// number of body bytes already received - int get countOfBytesReceived { - objc.checkOsVersionInternal( - 'NSURLSessionTask.countOfBytesReceived', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + return _objc_msgSend_pysgoz( + object$.ref.pointer, + _sel_countOfBytesExpectedToReceive, ); - return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesReceived); } /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request @@ -50328,76 +50168,88 @@ class NSURLSessionTask extends objc.NSObject macOS: (false, (10, 9, 0)), ); return _objc_msgSend_pysgoz( - this.ref.pointer, + object$.ref.pointer, _sel_countOfBytesExpectedToSend, ); } - /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. - int get countOfBytesExpectedToReceive { + /// number of body bytes already received + int get countOfBytesReceived { objc.checkOsVersionInternal( - 'NSURLSessionTask.countOfBytesExpectedToReceive', + 'NSURLSessionTask.countOfBytesReceived', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - return _objc_msgSend_pysgoz( - this.ref.pointer, - _sel_countOfBytesExpectedToReceive, - ); + return _objc_msgSend_pysgoz(object$.ref.pointer, _sel_countOfBytesReceived); } - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - objc.NSString? get taskDescription { + /// number of body bytes already sent + int get countOfBytesSent { objc.checkOsVersionInternal( - 'NSURLSessionTask.taskDescription', + 'NSURLSessionTask.countOfBytesSent', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_taskDescription); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + return _objc_msgSend_pysgoz(object$.ref.pointer, _sel_countOfBytesSent); } - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - set taskDescription(objc.NSString? value) { + /// may differ from originalRequest due to http server redirection + NSURLRequest? get currentRequest { objc.checkOsVersionInternal( - 'NSURLSessionTask.setTaskDescription:', + 'NSURLSessionTask.currentRequest', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setTaskDescription_, - value?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_currentRequest, ); + return $ret.address == 0 + ? null + : NSURLRequest.fromPointer($ret, retain: true, release: true); } - /// -cancel returns immediately, but marks a task as being canceled. - /// The task will signal -URLSession:task:didCompleteWithError: with an - /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some - /// cases, the task may signal other work before it acknowledges the - /// cancelation. -cancel may be sent to a task that has been suspended. - void cancel() { + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + NSURLSessionTaskDelegate? get delegate { objc.checkOsVersionInternal( - 'NSURLSessionTask.cancel', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionTask.delegate', + iOS: (false, (15, 0, 0)), + macOS: (false, (12, 0, 0)), ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancel); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_delegate); + return $ret.address == 0 + ? null + : NSURLSessionTaskDelegate.fromPointer( + $ret, + retain: true, + release: true, + ); } - /// The current state of the task within the session. - NSURLSessionTaskState get state { + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + objc.NSDate? get earliestBeginDate { objc.checkOsVersionInternal( - 'NSURLSessionTask.state', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionTask.earliestBeginDate', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_earliestBeginDate, ); - final _ret = _objc_msgSend_1vze0g9(this.ref.pointer, _sel_state); - return NSURLSessionTaskState.fromValue(_ret); + return $ret.address == 0 + ? null + : objc.NSDate.fromPointer($ret, retain: true, release: true); } /// The error, if any, delivered via -URLSession:task:didCompleteWithError: @@ -50408,36 +50260,60 @@ class NSURLSessionTask extends objc.NSObject iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_error); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_error); + return $ret.address == 0 ? null - : objc.NSError.castFromPointer(_ret, retain: true, release: true); + : objc.NSError.fromPointer($ret, retain: true, release: true); } - /// Suspending a task will prevent the NSURLSession from continuing to - /// load data. There may still be delegate calls made on behalf of - /// this task (for instance, to report data received while suspending) - /// but no further transmissions will be made on behalf of the task - /// until -resume is sent. The timeout timer associated with the task - /// will be disabled while a task is suspended. -suspend and -resume are - /// nestable. - void suspend() { + /// init + NSURLSessionTask init() { objc.checkOsVersionInternal( - 'NSURLSessionTask.suspend', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionTask.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_suspend); + return NSURLSessionTask.fromPointer($ret, retain: false, release: true); } - /// resume - void resume() { + /// may be nil if this is a stream task + NSURLRequest? get originalRequest { objc.checkOsVersionInternal( - 'NSURLSessionTask.resume', + 'NSURLSessionTask.originalRequest', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_resume); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_originalRequest, + ); + return $ret.address == 0 + ? null + : NSURLRequest.fromPointer($ret, retain: true, release: true); + } + + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + bool get prefersIncrementalDelivery { + objc.checkOsVersionInternal( + 'NSURLSessionTask.prefersIncrementalDelivery', + iOS: (false, (14, 5, 0)), + macOS: (false, (11, 3, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_prefersIncrementalDelivery, + ); } /// Sets a scaling factor for the priority of the task. The scaling factor is a @@ -50460,240 +50336,228 @@ class NSURLSessionTask extends objc.NSObject macOS: (false, (10, 10, 0)), ); return objc.useMsgSendVariants - ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_priority) - : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_priority); + ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_priority) + : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_priority); } - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. - /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. - /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - set priority(double value) { + /// progress + objc.NSProgress get progress { + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_progress); + return objc.NSProgress.fromPointer($ret, retain: true, release: true); + } + + /// may be nil if no response has been received + NSURLResponse? get response { objc.checkOsVersionInternal( - 'NSURLSessionTask.setPriority:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + 'NSURLSessionTask.response', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPriority_, value); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_response); + return $ret.address == 0 + ? null + : NSURLResponse.fromPointer($ret, retain: true, release: true); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - bool get prefersIncrementalDelivery { + /// resume + void resume() { objc.checkOsVersionInternal( - 'NSURLSessionTask.prefersIncrementalDelivery', - iOS: (false, (14, 5, 0)), - macOS: (false, (11, 3, 0)), - ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_prefersIncrementalDelivery, + 'NSURLSessionTask.resume', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_resume); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - set prefersIncrementalDelivery(bool value) { - objc.checkOsVersionInternal( + /// setCountOfBytesClientExpectsToReceive: + set countOfBytesClientExpectsToReceive(int value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setCountOfBytesClientExpectsToReceive:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + _objc_msgSend_17gvxvj( + object$.ref.pointer, + _sel_setCountOfBytesClientExpectsToReceive_, + value, + ); + } + + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + set countOfBytesClientExpectsToSend(int value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setCountOfBytesClientExpectsToSend:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + _objc_msgSend_17gvxvj( + object$.ref.pointer, + _sel_setCountOfBytesClientExpectsToSend_, + value, + ); + } + + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + set delegate(NSURLSessionTaskDelegate? value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setDelegate:', + iOS: (false, (15, 0, 0)), + macOS: (false, (12, 0, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setDelegate_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + set earliestBeginDate(objc.NSDate? value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setEarliestBeginDate:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setEarliestBeginDate_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + set prefersIncrementalDelivery(bool value) { + objc.checkOsVersionInternal( 'NSURLSessionTask.setPrefersIncrementalDelivery:', iOS: (false, (14, 5, 0)), macOS: (false, (11, 3, 0)), ); _objc_msgSend_1s56lr9( - this.ref.pointer, + object$.ref.pointer, _sel_setPrefersIncrementalDelivery_, value, ); } - /// init - NSURLSessionTask init() { + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. + /// + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. + /// + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + set priority(double value) { objc.checkOsVersionInternal( - 'NSURLSessionTask.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + 'NSURLSessionTask.setPriority:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLSessionTask new$() { - final _ret = _objc_msgSend_151sglz(_class_NSURLSessionTask, _sel_new); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + _objc_msgSend_v5hmet(object$.ref.pointer, _sel_setPriority_, value); } - /// allocWithZone: - static NSURLSessionTask allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSessionTask, - _sel_allocWithZone_, - zone, + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + set taskDescription(objc.NSString? value) { + objc.checkOsVersionInternal( + 'NSURLSessionTask.setTaskDescription:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setTaskDescription_, + value?.ref.pointer ?? ffi.nullptr, ); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// alloc - static NSURLSessionTask alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSURLSessionTask, _sel_alloc); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + /// The current state of the task within the session. + NSURLSessionTaskState get state { + objc.checkOsVersionInternal( + 'NSURLSessionTask.state', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_1vze0g9(object$.ref.pointer, _sel_state); + return NSURLSessionTaskState.fromValue($ret); } - /// self - NSURLSessionTask self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// Suspending a task will prevent the NSURLSession from continuing to + /// load data. There may still be delegate calls made on behalf of + /// this task (for instance, to report data received while suspending) + /// but no further transmissions will be made on behalf of the task + /// until -resume is sent. The timeout timer associated with the task + /// will be disabled while a task is suspended. -suspend and -resume are + /// nestable. + void suspend() { + objc.checkOsVersionInternal( + 'NSURLSessionTask.suspend', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_suspend); } - /// retain - NSURLSessionTask retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + objc.NSString? get taskDescription { + objc.checkOsVersionInternal( + 'NSURLSessionTask.taskDescription', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_taskDescription, + ); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// autorelease - NSURLSessionTask autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// an identifier for this task, assigned by and unique to the owning session + DartNSUInteger get taskIdentifier { + objc.checkOsVersionInternal( + 'NSURLSessionTask.taskIdentifier', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_taskIdentifier); } - - /// Returns a new instance of NSURLSessionTask constructed with the default `new` method. - factory NSURLSessionTask() => new$(); } late final _sel_storeCookies_forTask_ = objc.registerName( "storeCookies:forTask:", ); -void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSArray_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSArray_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSArray_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSArray_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSArray_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSArray { +abstract final class ObjCBlock_ffiVoid_NSArray$1 { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -50710,11 +50574,13 @@ abstract final class ObjCBlock_ffiVoid_NSArray { /// will result in a crash. static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction arg0)> + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSArray_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -50732,11 +50598,11 @@ abstract final class ObjCBlock_ffiVoid_NSArray { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_closureCallable, - (ffi.Pointer arg0) => fn( + _closureCallable, + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSArray.castFromPointer(arg0, retain: true, release: true), + : objc.NSArray.fromPointer(arg0, retain: true, release: true), ), keepIsolateAlive, ), @@ -50758,11 +50624,11 @@ abstract final class ObjCBlock_ffiVoid_NSArray { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSArray.castFromPointer(arg0, retain: false, release: true), + : objc.NSArray.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -50790,20 +50656,20 @@ abstract final class ObjCBlock_ffiVoid_NSArray { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSArray.castFromPointer(arg0, retain: false, release: true), + : objc.NSArray.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_blockingListenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSArray.castFromPointer(arg0, retain: false, release: true), + : objc.NSArray.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -50820,24 +50686,127 @@ abstract final class ObjCBlock_ffiVoid_NSArray { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSArray_CallExtension +extension ObjCBlock_ffiVoid_NSArray$1$CallExtension on objc.ObjCBlock { void call(objc.NSArray? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } @@ -50848,21 +50817,6 @@ late final _sel_getCookiesForTask_completionHandler_ = objc.registerName( /// NSURLSessionTaskAdditions extension NSURLSessionTaskAdditions$1 on NSHTTPCookieStorage { - /// storeCookies:forTask: - void storeCookies(objc.NSArray cookies, {required NSURLSessionTask forTask}) { - objc.checkOsVersionInternal( - 'NSHTTPCookieStorage.storeCookies:forTask:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_storeCookies_forTask_, - cookies.ref.pointer, - forTask.ref.pointer, - ); - } - /// getCookiesForTask:completionHandler: void getCookiesForTask( NSURLSessionTask task, { @@ -50874,12 +50828,27 @@ extension NSURLSessionTaskAdditions$1 on NSHTTPCookieStorage { macOS: (false, (10, 10, 0)), ); _objc_msgSend_o762yo( - this.ref.pointer, + object$.ref.pointer, _sel_getCookiesForTask_completionHandler_, task.ref.pointer, completionHandler.ref.pointer, ); } + + /// storeCookies:forTask: + void storeCookies(objc.NSArray cookies, {required NSURLSessionTask forTask}) { + objc.checkOsVersionInternal( + 'NSHTTPCookieStorage.storeCookies:forTask:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_storeCookies_forTask_, + cookies.ref.pointer, + forTask.ref.pointer, + ); + } } late final _class_NSDictionary = objc.getClass("NSDictionary"); @@ -50888,19 +50857,19 @@ final _objc_msgSend_hefmm1 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, ) > >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, ) >(); late final _sel_dictionaryWithContentsOfFile_ = objc.registerName( @@ -50922,18 +50891,18 @@ final _objc_msgSend_1iyq28l = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Bool, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, bool, ) >(); @@ -50945,8 +50914,8 @@ late final _sel_writeToURL_atomically_ = objc.registerName( extension NSDeprecated on objc.NSDictionary { /// getObjects:andKeys: void getObjects( - ffi.Pointer> objects, { - required ffi.Pointer> andKeys, + ffi.Pointer> objects, { + required ffi.Pointer> andKeys, }) { objc.checkOsVersionInternal( 'NSDictionary.getObjects:andKeys:', @@ -50954,47 +50923,13 @@ extension NSDeprecated on objc.NSDictionary { macOS: (false, (10, 0, 0)), ); _objc_msgSend_hefmm1( - this.ref.pointer, + object$.ref.pointer, _sel_getObjects_andKeys_, objects, andKeys, ); } - /// dictionaryWithContentsOfFile: - static objc.NSDictionary? dictionaryWithContentsOfFile(objc.NSString path) { - objc.checkOsVersionInternal( - 'NSDictionary.dictionaryWithContentsOfFile:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSDictionary, - _sel_dictionaryWithContentsOfFile_, - path.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// dictionaryWithContentsOfURL: - static objc.NSDictionary? dictionaryWithContentsOfURL(objc.NSURL url) { - objc.checkOsVersionInternal( - 'NSDictionary.dictionaryWithContentsOfURL:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSDictionary, - _sel_dictionaryWithContentsOfURL_, - url.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - /// initWithContentsOfFile: objc.NSDictionary? initWithContentsOfFile(objc.NSString path) { objc.checkOsVersionInternal( @@ -51002,14 +50937,14 @@ extension NSDeprecated on objc.NSDictionary { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithContentsOfFile_, path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + : objc.NSDictionary.fromPointer($ret, retain: false, release: true); } /// initWithContentsOfURL: @@ -51019,14 +50954,14 @@ extension NSDeprecated on objc.NSDictionary { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_, url.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + : objc.NSDictionary.fromPointer($ret, retain: false, release: true); } /// writeToFile:atomically: @@ -51037,7 +50972,7 @@ extension NSDeprecated on objc.NSDictionary { macOS: (false, (10, 0, 0)), ); return _objc_msgSend_1iyq28l( - this.ref.pointer, + object$.ref.pointer, _sel_writeToFile_atomically_, path.ref.pointer, atomically, @@ -51052,12 +50987,46 @@ extension NSDeprecated on objc.NSDictionary { macOS: (false, (10, 0, 0)), ); return _objc_msgSend_1iyq28l( - this.ref.pointer, + object$.ref.pointer, _sel_writeToURL_atomically_, url.ref.pointer, atomically, ); } + + /// dictionaryWithContentsOfFile: + static objc.NSDictionary? dictionaryWithContentsOfFile(objc.NSString path) { + objc.checkOsVersionInternal( + 'NSDictionary.dictionaryWithContentsOfFile:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSDictionary, + _sel_dictionaryWithContentsOfFile_, + path.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } + + /// dictionaryWithContentsOfURL: + static objc.NSDictionary? dictionaryWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSDictionary.dictionaryWithContentsOfURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSDictionary, + _sel_dictionaryWithContentsOfURL_, + url.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } } late final _sel_dictionary = objc.registerName("dictionary"); @@ -51070,21 +51039,21 @@ late final _sel_dictionaryWithObjects_forKeys_count_ = objc.registerName( final _objc_msgSend_1dydpdi = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, int, ) >(); @@ -51107,19 +51076,19 @@ late final _sel_initWithDictionary_copyItems_ = objc.registerName( final _objc_msgSend_17amj0z = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Bool, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, bool, ) >(); @@ -51132,20 +51101,20 @@ late final _sel_initWithContentsOfURL_error_ = objc.registerName( final _objc_msgSend_1lhpu4m = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, ) >(); late final _sel_dictionaryWithContentsOfURL_error_ = objc.registerName( @@ -51154,182 +51123,172 @@ late final _sel_dictionaryWithContentsOfURL_error_ = objc.registerName( /// NSDictionaryCreation extension NSDictionaryCreation on objc.NSDictionary { - /// dictionary - static objc.NSDictionary dictionary() { - final _ret = _objc_msgSend_151sglz(_class_NSDictionary, _sel_dictionary); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// dictionaryWithObject:forKey: - static objc.NSDictionary dictionaryWithObject( - objc.ObjCObjectBase object, { - required objc.ObjCObjectBase forKey, - }) { - final _ret = _objc_msgSend_15qeuct( - _class_NSDictionary, - _sel_dictionaryWithObject_forKey_, - object.ref.pointer, - forKey.ref.pointer, - ); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// dictionaryWithObjects:forKeys:count: - static objc.NSDictionary dictionaryWithObjects( - ffi.Pointer> objects, { - required ffi.Pointer> forKeys, - required DartNSUInteger count, - }) { - final _ret = _objc_msgSend_1dydpdi( - _class_NSDictionary, - _sel_dictionaryWithObjects_forKeys_count_, - objects, - forKeys, - count, + /// initWithContentsOfURL:error: + objc.NSDictionary? initWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSDictionary.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, + url.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: false, release: true); + } finally { + pkg_ffi.calloc.free($err); + } } - /// dictionaryWithObjectsAndKeys: - static objc.NSDictionary dictionaryWithObjectsAndKeys( - objc.ObjCObjectBase firstObject, - ) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSDictionary, - _sel_dictionaryWithObjectsAndKeys_, - firstObject.ref.pointer, + /// initWithDictionary: + objc.NSDictionary initWithDictionary(objc.NSDictionary otherDictionary) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithDictionary_, + otherDictionary.ref.pointer, ); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + return objc.NSDictionary.fromPointer($ret, retain: false, release: true); } - /// dictionaryWithDictionary: - static objc.NSDictionary dictionaryWithDictionary(objc.NSDictionary dict) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSDictionary, - _sel_dictionaryWithDictionary_, - dict.ref.pointer, + /// initWithDictionary:copyItems: + objc.NSDictionary initWithDictionary$1( + objc.NSDictionary otherDictionary, { + required bool copyItems, + }) { + final $ret = _objc_msgSend_17amj0z( + object$.ref.retainAndReturnPointer(), + _sel_initWithDictionary_copyItems_, + otherDictionary.ref.pointer, + copyItems, ); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + return objc.NSDictionary.fromPointer($ret, retain: false, release: true); } - /// dictionaryWithObjects:forKeys: - static objc.NSDictionary dictionaryWithObjects$1( + /// initWithObjects:forKeys: + objc.NSDictionary initWithObjects$1( objc.NSArray objects, { required objc.NSArray forKeys, }) { - final _ret = _objc_msgSend_15qeuct( - _class_NSDictionary, - _sel_dictionaryWithObjects_forKeys_, + final $ret = _objc_msgSend_15qeuct( + object$.ref.retainAndReturnPointer(), + _sel_initWithObjects_forKeys_, objects.ref.pointer, forKeys.ref.pointer, ); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + return objc.NSDictionary.fromPointer($ret, retain: false, release: true); } /// initWithObjectsAndKeys: - objc.NSDictionary initWithObjectsAndKeys(objc.ObjCObjectBase firstObject) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + objc.NSDictionary initWithObjectsAndKeys(objc.ObjCObject firstObject) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithObjectsAndKeys_, firstObject.ref.pointer, ); - return objc.NSDictionary.castFromPointer( - _ret, - retain: false, - release: true, - ); + return objc.NSDictionary.fromPointer($ret, retain: false, release: true); } - /// initWithDictionary: - objc.NSDictionary initWithDictionary(objc.NSDictionary otherDictionary) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithDictionary_, - otherDictionary.ref.pointer, + /// dictionary + static objc.NSDictionary dictionary() { + final $ret = _objc_msgSend_151sglz(_class_NSDictionary, _sel_dictionary); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } + + /// dictionaryWithContentsOfURL:error: + static objc.NSDictionary? dictionaryWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSDictionary.dictionaryWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - return objc.NSDictionary.castFromPointer( - _ret, - retain: false, - release: true, + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _class_NSDictionary, + _sel_dictionaryWithContentsOfURL_error_, + url.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } + + /// dictionaryWithDictionary: + static objc.NSDictionary dictionaryWithDictionary(objc.NSDictionary dict) { + final $ret = _objc_msgSend_1sotr3r( + _class_NSDictionary, + _sel_dictionaryWithDictionary_, + dict.ref.pointer, ); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// initWithDictionary:copyItems: - objc.NSDictionary initWithDictionary$1( - objc.NSDictionary otherDictionary, { - required bool copyItems, + /// dictionaryWithObject:forKey: + static objc.NSDictionary dictionaryWithObject( + objc.ObjCObject object, { + required objc.ObjCObject forKey, }) { - final _ret = _objc_msgSend_17amj0z( - this.ref.retainAndReturnPointer(), - _sel_initWithDictionary_copyItems_, - otherDictionary.ref.pointer, - copyItems, - ); - return objc.NSDictionary.castFromPointer( - _ret, - retain: false, - release: true, + final $ret = _objc_msgSend_15qeuct( + _class_NSDictionary, + _sel_dictionaryWithObject_forKey_, + object.ref.pointer, + forKey.ref.pointer, ); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// initWithObjects:forKeys: - objc.NSDictionary initWithObjects( + /// dictionaryWithObjects:forKeys: + static objc.NSDictionary dictionaryWithObjects( objc.NSArray objects, { required objc.NSArray forKeys, }) { - final _ret = _objc_msgSend_15qeuct( - this.ref.retainAndReturnPointer(), - _sel_initWithObjects_forKeys_, + final $ret = _objc_msgSend_15qeuct( + _class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_, objects.ref.pointer, forKeys.ref.pointer, ); - return objc.NSDictionary.castFromPointer( - _ret, - retain: false, - release: true, - ); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// initWithContentsOfURL:error: - objc.NSDictionary? initWithContentsOfURL( - objc.NSURL url, { - required ffi.Pointer> error, + /// dictionaryWithObjects:forKeys:count: + static objc.NSDictionary dictionaryWithObjects$1( + ffi.Pointer> objects, { + required ffi.Pointer> forKeys, + required DartNSUInteger count, }) { - objc.checkOsVersionInternal( - 'NSDictionary.initWithContentsOfURL:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final _ret = _objc_msgSend_1lhpu4m( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_error_, - url.ref.pointer, - error, + final $ret = _objc_msgSend_1dydpdi( + _class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_count_, + objects, + forKeys, + count, ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// dictionaryWithContentsOfURL:error: - static objc.NSDictionary? dictionaryWithContentsOfURL( - objc.NSURL url, { - required ffi.Pointer> error, - }) { - objc.checkOsVersionInternal( - 'NSDictionary.dictionaryWithContentsOfURL:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final _ret = _objc_msgSend_1lhpu4m( + /// dictionaryWithObjectsAndKeys: + static objc.NSDictionary dictionaryWithObjectsAndKeys( + objc.ObjCObject firstObject, + ) { + final $ret = _objc_msgSend_1sotr3r( _class_NSDictionary, - _sel_dictionaryWithContentsOfURL_error_, - url.ref.pointer, - error, + _sel_dictionaryWithObjectsAndKeys_, + firstObject.ref.pointer, ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } } @@ -51340,16 +51299,16 @@ late final _sel_dictionaryWithCapacity_ = objc.registerName( final _objc_msgSend_14hpxwa = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.UnsignedLong, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, ) @@ -51357,17 +51316,49 @@ final _objc_msgSend_14hpxwa = objc.msgSendPointer /// NSMutableDictionaryCreation extension NSMutableDictionaryCreation on objc.NSMutableDictionary { + /// initWithContentsOfFile: + objc.NSMutableDictionary? initWithContentsOfFile(objc.NSString path) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, + path.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSMutableDictionary.fromPointer( + $ret, + retain: false, + release: true, + ); + } + + /// initWithContentsOfURL: + objc.NSMutableDictionary? initWithContentsOfURL(objc.NSURL url) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, + url.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSMutableDictionary.fromPointer( + $ret, + retain: false, + release: true, + ); + } + /// dictionaryWithCapacity: static objc.NSMutableDictionary dictionaryWithCapacity( DartNSUInteger numItems, ) { - final _ret = _objc_msgSend_14hpxwa( + final $ret = _objc_msgSend_14hpxwa( _class_NSMutableDictionary, _sel_dictionaryWithCapacity_, numItems, ); - return objc.NSMutableDictionary.castFromPointer( - _ret, + return objc.NSMutableDictionary.fromPointer( + $ret, retain: true, release: true, ); @@ -51377,15 +51368,15 @@ extension NSMutableDictionaryCreation on objc.NSMutableDictionary { static objc.NSMutableDictionary? dictionaryWithContentsOfFile( objc.NSString path, ) { - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSMutableDictionary, _sel_dictionaryWithContentsOfFile_, path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSMutableDictionary.castFromPointer( - _ret, + : objc.NSMutableDictionary.fromPointer( + $ret, retain: true, release: true, ); @@ -51393,72 +51384,40 @@ extension NSMutableDictionaryCreation on objc.NSMutableDictionary { /// dictionaryWithContentsOfURL: static objc.NSMutableDictionary? dictionaryWithContentsOfURL(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSMutableDictionary, _sel_dictionaryWithContentsOfURL_, url.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSMutableDictionary.castFromPointer( - _ret, + : objc.NSMutableDictionary.fromPointer( + $ret, retain: true, release: true, ); } +} - /// initWithContentsOfFile: - objc.NSMutableDictionary? initWithContentsOfFile(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, - path.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer( - _ret, - retain: false, - release: true, - ); - } - - /// initWithContentsOfURL: - objc.NSMutableDictionary? initWithContentsOfURL(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, - url.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer( - _ret, - retain: false, - release: true, - ); - } -} - -late final _sel_sharedKeySetForKeys_ = objc.registerName( - "sharedKeySetForKeys:", -); +late final _sel_sharedKeySetForKeys_ = objc.registerName( + "sharedKeySetForKeys:", +); /// NSSharedKeySetDictionary extension NSSharedKeySetDictionary on objc.NSDictionary { /// sharedKeySetForKeys: - static objc.ObjCObjectBase sharedKeySetForKeys(objc.NSArray keys) { + static objc.ObjCObject sharedKeySetForKeys(objc.NSArray keys) { objc.checkOsVersionInternal( 'NSDictionary.sharedKeySetForKeys:', iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0)), ); - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSDictionary, _sel_sharedKeySetForKeys_, keys.ref.pointer, ); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + return objc.ObjCObject($ret, retain: true, release: true); } } @@ -51470,20 +51429,20 @@ late final _sel_dictionaryWithSharedKeySet_ = objc.registerName( extension NSSharedKeySetDictionary$1 on objc.NSMutableDictionary { /// dictionaryWithSharedKeySet: static objc.NSMutableDictionary dictionaryWithSharedKeySet( - objc.ObjCObjectBase keyset, + objc.ObjCObject keyset, ) { objc.checkOsVersionInternal( 'NSMutableDictionary.dictionaryWithSharedKeySet:', iOS: (false, (6, 0, 0)), macOS: (false, (10, 8, 0)), ); - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSMutableDictionary, _sel_dictionaryWithSharedKeySet_, keyset.ref.pointer, ); - return objc.NSMutableDictionary.castFromPointer( - _ret, + return objc.NSMutableDictionary.fromPointer( + $ret, retain: true, release: true, ); @@ -51497,107 +51456,36 @@ final _objc_msgSend_1b5ysjl = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.UnsignedLong Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > >() .asFunction< int Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, int, ) >(); -int -_ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, - int arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, - NSUInteger arg3, - ) - > - >() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger, - ) - >( - _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrTrampoline, - 0, - ) - .cast(); -int -_ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, - int arg3, -) => - (objc.getBlockClosure(block) - as int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger, - ) - >( - _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureTrampoline, - 0, - ) - .cast(); -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. -abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. +abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObjectImpl_NSUInteger { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -51606,7 +51494,7 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) >(pointer, retain: retain, release: release); @@ -51620,7 +51508,7 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > @@ -51630,7 +51518,7 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj NSUInteger Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, NSUInteger arg3, ) > @@ -51641,14 +51529,11 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) >( - objc.newPointerBlock( - _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -51665,7 +51550,7 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > @@ -51673,7 +51558,7 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj DartNSUInteger Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, DartNSUInteger, ) fn, { @@ -51683,16 +51568,16 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) >( objc.newClosureBlock( - _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable, + _closureCallable, ( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, int arg3, ) => fn(arg0, arg1, arg2, arg3), keepIsolateAlive, @@ -51700,23 +51585,85 @@ abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObj retain: false, release: true, ); + + static int _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + NSUInteger arg3, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger, + ) + >(_fnPtrTrampoline, 0) + .cast(); + static int _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3, + ) => + (objc.getBlockClosure(block) + as int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger, + ) + >(_closureTrampoline, 0) + .cast(); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. -extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_CallExtension +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. +extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObjectImpl_NSUInteger$CallExtension on objc.ObjCBlock< ffi.UnsignedLong Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > { DartNSUInteger call( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, DartNSUInteger arg3, ) => ref.pointer.ref.invoke .cast< @@ -51725,7 +51672,7 @@ extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSU ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer> arg2, NSUInteger arg3, ) > @@ -51735,7 +51682,7 @@ extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSU ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, int, ) >()(ref.pointer, arg0, arg1, arg2, arg3); @@ -51746,11 +51693,11 @@ extension NSGenericFastEnumeration on objc.NSDictionary { /// countByEnumeratingWithState:objects:count: DartNSUInteger countByEnumeratingWithState( ffi.Pointer state, { - required ffi.Pointer> objects, + required ffi.Pointer> objects, required DartNSUInteger count, }) { return _objc_msgSend_1b5ysjl( - this.ref.pointer, + object$.ref.pointer, _sel_countByEnumeratingWithState_objects_count_, state, objects, @@ -51759,56 +51706,14 @@ extension NSGenericFastEnumeration on objc.NSDictionary { } } -typedef NSProgressKind = ffi.Pointer; +typedef NSProgressKind = ffi.Pointer; typedef DartNSProgressKind = objc.NSString; -typedef NSProgressUserInfoKey = ffi.Pointer; +typedef NSProgressUserInfoKey = ffi.Pointer; typedef DartNSProgressUserInfoKey = objc.NSString; -typedef NSProgressFileOperationKind = ffi.Pointer; +typedef NSProgressFileOperationKind = ffi.Pointer; typedef DartNSProgressFileOperationKind = objc.NSString; typedef NSProgressUnpublishingHandler = ffi.Pointer; typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; -NSProgressUnpublishingHandler -_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0, - ) - > - >() - .asFunction< - NSProgressUnpublishingHandler Function(ffi.Pointer) - >()(arg0); -ffi.Pointer -_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(); -NSProgressUnpublishingHandler -_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as NSProgressUnpublishingHandler Function( - ffi.Pointer, - ))(arg0); -ffi.Pointer -_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(); /// Construction methods for `objc.ObjCBlock? Function(objc.NSProgress)>`. abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { @@ -51816,7 +51721,7 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { static objc.ObjCBlock< objc.ObjCBlock? Function(objc.NSProgress) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -51837,7 +51742,7 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { ffi.Pointer< ffi.NativeFunction< NSProgressUnpublishingHandler Function( - ffi.Pointer arg0, + ffi.Pointer arg0, ) > > @@ -51846,10 +51751,7 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { objc.ObjCBlock< objc.ObjCBlock? Function(objc.NSProgress) >( - objc.newPointerBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -51873,14 +51775,10 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { objc.ObjCBlock? Function(objc.NSProgress) >( objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => + _closureCallable, + (ffi.Pointer arg0) => fn( - objc.NSProgress.castFromPointer( - arg0, - retain: true, - release: true, - ), + objc.NSProgress.fromPointer(arg0, retain: true, release: true), )?.ref.retainAndAutorelease() ?? ffi.nullptr, keepIsolateAlive, @@ -51888,10 +51786,49 @@ abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { retain: false, release: true, ); + + static NSProgressUnpublishingHandler _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0, + ) + > + >() + .asFunction< + NSProgressUnpublishingHandler Function(ffi.Pointer) + >()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static NSProgressUnpublishingHandler _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as NSProgressUnpublishingHandler Function( + ffi.Pointer, + ))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock? Function(objc.NSProgress)>`. -extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension +extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress$CallExtension on objc.ObjCBlock< objc.ObjCBlock? Function(objc.NSProgress) @@ -51902,33 +51839,33 @@ extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension ffi.NativeFunction< NSProgressUnpublishingHandler Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< NSProgressUnpublishingHandler Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.ref.pointer) .address == 0 ? null - : ObjCBlock_ffiVoid.castFromPointer( + : ObjCBlock_ffiVoid.fromPointer( ref.pointer.ref.invoke .cast< ffi.NativeFunction< NSProgressUnpublishingHandler Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< NSProgressUnpublishingHandler Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.ref.pointer), retain: true, @@ -52008,26 +51945,20 @@ typedef Dartos_block_t = objc.ObjCBlock; /// OS_object in your config's objc-interfaces list. /// /// OS_object -class OS_object extends objc.NSObject { - OS_object._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - +extension type OS_object._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { /// Constructs a [OS_object] that points to the same underlying object as [other]. - OS_object.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + OS_object.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [OS_object] that wraps the given raw object pointer. - OS_object.castFromPointer( - ffi.Pointer other, { + OS_object.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } -typedef sec_object_t = ffi.Pointer; +typedef sec_object_t = ffi.Pointer; typedef Dartsec_object_t = objc.NSObject; final class __SecCertificate extends ffi.Opaque {} @@ -52202,6 +52133,10 @@ final class _RuneLocale extends ffi.Struct { external ffi.Pointer<_RuneCharClass> __charclasses; } +final class _xlocale extends ffi.Opaque {} + +typedef locale_t = ffi.Pointer<_xlocale>; + final class lconv extends ffi.Struct { external ffi.Pointer decimal_point; @@ -52266,9 +52201,6 @@ final class lconv extends ffi.Struct { external int int_n_sign_posn; } -final class _xlocale extends ffi.Opaque {} - -typedef locale_t = ffi.Pointer<_xlocale>; typedef float_t = ffi.Float; typedef Dartfloat_t = double; typedef double_t = ffi.Double; @@ -52855,18 +52787,9 @@ final class __CFData extends ffi.Opaque {} typedef CFDataRef = ffi.Pointer<__CFData>; typedef CFMutableDataRef = ffi.Pointer<__CFData>; -enum CFDataSearchFlags { - kCFDataSearchBackwards(1), - kCFDataSearchAnchored(2); - - final int value; - const CFDataSearchFlags(this.value); - - static CFDataSearchFlags fromValue(int value) => switch (value) { - 1 => kCFDataSearchBackwards, - 2 => kCFDataSearchAnchored, - _ => throw ArgumentError('Unknown value for CFDataSearchFlags: $value'), - }; +sealed class CFDataSearchFlags { + static const kCFDataSearchBackwards = 1; + static const kCFDataSearchAnchored = 2; } final class __CFCharacterSet extends ffi.Opaque {} @@ -52923,32 +52846,16 @@ final class __CFError extends ffi.Opaque {} typedef CFErrorRef = ffi.Pointer<__CFError>; typedef CFStringEncoding = UInt32; -enum CFStringCompareFlags { - kCFCompareCaseInsensitive(1), - kCFCompareBackwards(4), - kCFCompareAnchored(8), - kCFCompareNonliteral(16), - kCFCompareLocalized(32), - kCFCompareNumerically(64), - kCFCompareDiacriticInsensitive(128), - kCFCompareWidthInsensitive(256), - kCFCompareForcedOrdering(512); - - final int value; - const CFStringCompareFlags(this.value); - - static CFStringCompareFlags fromValue(int value) => switch (value) { - 1 => kCFCompareCaseInsensitive, - 4 => kCFCompareBackwards, - 8 => kCFCompareAnchored, - 16 => kCFCompareNonliteral, - 32 => kCFCompareLocalized, - 64 => kCFCompareNumerically, - 128 => kCFCompareDiacriticInsensitive, - 256 => kCFCompareWidthInsensitive, - 512 => kCFCompareForcedOrdering, - _ => throw ArgumentError('Unknown value for CFStringCompareFlags: $value'), - }; +sealed class CFStringCompareFlags { + static const kCFCompareCaseInsensitive = 1; + static const kCFCompareBackwards = 4; + static const kCFCompareAnchored = 8; + static const kCFCompareNonliteral = 16; + static const kCFCompareLocalized = 32; + static const kCFCompareNumerically = 64; + static const kCFCompareDiacriticInsensitive = 128; + static const kCFCompareWidthInsensitive = 256; + static const kCFCompareForcedOrdering = 512; } enum CFStringNormalizationForm { @@ -53016,44 +52923,22 @@ final class __CFCalendar extends ffi.Opaque {} typedef CFCalendarRef = ffi.Pointer<__CFCalendar>; -enum CFCalendarUnit { - kCFCalendarUnitEra(2), - kCFCalendarUnitYear(4), - kCFCalendarUnitMonth(8), - kCFCalendarUnitDay(16), - kCFCalendarUnitHour(32), - kCFCalendarUnitMinute(64), - kCFCalendarUnitSecond(128), - kCFCalendarUnitWeek(256), - kCFCalendarUnitWeekday(512), - kCFCalendarUnitWeekdayOrdinal(1024), - kCFCalendarUnitQuarter(2048), - kCFCalendarUnitWeekOfMonth(4096), - kCFCalendarUnitWeekOfYear(8192), - kCFCalendarUnitYearForWeekOfYear(16384), - kCFCalendarUnitDayOfYear(65536); - - final int value; - const CFCalendarUnit(this.value); - - static CFCalendarUnit fromValue(int value) => switch (value) { - 2 => kCFCalendarUnitEra, - 4 => kCFCalendarUnitYear, - 8 => kCFCalendarUnitMonth, - 16 => kCFCalendarUnitDay, - 32 => kCFCalendarUnitHour, - 64 => kCFCalendarUnitMinute, - 128 => kCFCalendarUnitSecond, - 256 => kCFCalendarUnitWeek, - 512 => kCFCalendarUnitWeekday, - 1024 => kCFCalendarUnitWeekdayOrdinal, - 2048 => kCFCalendarUnitQuarter, - 4096 => kCFCalendarUnitWeekOfMonth, - 8192 => kCFCalendarUnitWeekOfYear, - 16384 => kCFCalendarUnitYearForWeekOfYear, - 65536 => kCFCalendarUnitDayOfYear, - _ => throw ArgumentError('Unknown value for CFCalendarUnit: $value'), - }; +sealed class CFCalendarUnit { + static const kCFCalendarUnitEra = 2; + static const kCFCalendarUnitYear = 4; + static const kCFCalendarUnitMonth = 8; + static const kCFCalendarUnitDay = 16; + static const kCFCalendarUnitHour = 32; + static const kCFCalendarUnitMinute = 64; + static const kCFCalendarUnitSecond = 128; + static const kCFCalendarUnitWeek = 256; + static const kCFCalendarUnitWeekday = 512; + static const kCFCalendarUnitWeekdayOrdinal = 1024; + static const kCFCalendarUnitQuarter = 2048; + static const kCFCalendarUnitWeekOfMonth = 4096; + static const kCFCalendarUnitWeekOfYear = 8192; + static const kCFCalendarUnitYearForWeekOfYear = 16384; + static const kCFCalendarUnitDayOfYear = 65536; } typedef CGFloat = ffi.Double; @@ -53125,44 +53010,21 @@ enum CFDateFormatterStyle { }; } -enum CFISO8601DateFormatOptions { - kCFISO8601DateFormatWithYear(1), - kCFISO8601DateFormatWithMonth(2), - kCFISO8601DateFormatWithWeekOfYear(4), - kCFISO8601DateFormatWithDay(16), - kCFISO8601DateFormatWithTime(32), - kCFISO8601DateFormatWithTimeZone(64), - kCFISO8601DateFormatWithSpaceBetweenDateAndTime(128), - kCFISO8601DateFormatWithDashSeparatorInDate(256), - kCFISO8601DateFormatWithColonSeparatorInTime(512), - kCFISO8601DateFormatWithColonSeparatorInTimeZone(1024), - kCFISO8601DateFormatWithFractionalSeconds(2048), - kCFISO8601DateFormatWithFullDate(275), - kCFISO8601DateFormatWithFullTime(1632), - kCFISO8601DateFormatWithInternetDateTime(1907); - - final int value; - const CFISO8601DateFormatOptions(this.value); - - static CFISO8601DateFormatOptions fromValue(int value) => switch (value) { - 1 => kCFISO8601DateFormatWithYear, - 2 => kCFISO8601DateFormatWithMonth, - 4 => kCFISO8601DateFormatWithWeekOfYear, - 16 => kCFISO8601DateFormatWithDay, - 32 => kCFISO8601DateFormatWithTime, - 64 => kCFISO8601DateFormatWithTimeZone, - 128 => kCFISO8601DateFormatWithSpaceBetweenDateAndTime, - 256 => kCFISO8601DateFormatWithDashSeparatorInDate, - 512 => kCFISO8601DateFormatWithColonSeparatorInTime, - 1024 => kCFISO8601DateFormatWithColonSeparatorInTimeZone, - 2048 => kCFISO8601DateFormatWithFractionalSeconds, - 275 => kCFISO8601DateFormatWithFullDate, - 1632 => kCFISO8601DateFormatWithFullTime, - 1907 => kCFISO8601DateFormatWithInternetDateTime, - _ => throw ArgumentError( - 'Unknown value for CFISO8601DateFormatOptions: $value', - ), - }; +sealed class CFISO8601DateFormatOptions { + static const kCFISO8601DateFormatWithYear = 1; + static const kCFISO8601DateFormatWithMonth = 2; + static const kCFISO8601DateFormatWithWeekOfYear = 4; + static const kCFISO8601DateFormatWithDay = 16; + static const kCFISO8601DateFormatWithTime = 32; + static const kCFISO8601DateFormatWithTimeZone = 64; + static const kCFISO8601DateFormatWithSpaceBetweenDateAndTime = 128; + static const kCFISO8601DateFormatWithDashSeparatorInDate = 256; + static const kCFISO8601DateFormatWithColonSeparatorInTime = 512; + static const kCFISO8601DateFormatWithColonSeparatorInTimeZone = 1024; + static const kCFISO8601DateFormatWithFractionalSeconds = 2048; + static const kCFISO8601DateFormatWithFullDate = 275; + static const kCFISO8601DateFormatWithFullTime = 1632; + static const kCFISO8601DateFormatWithInternetDateTime = 1907; } final class __CFBoolean extends ffi.Opaque {} @@ -53317,62 +53179,22 @@ enum CFURLComponentType { final class FSRef extends ffi.Opaque {} -enum CFURLBookmarkCreationOptions { - kCFURLBookmarkCreationMinimalBookmarkMask(512), - kCFURLBookmarkCreationSuitableForBookmarkFile(1024), - kCFURLBookmarkCreationWithSecurityScope(2048), - kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess(4096), - kCFURLBookmarkCreationWithoutImplicitSecurityScope(536870912), - kCFURLBookmarkCreationPreferFileIDResolutionMask(256); - - final int value; - const CFURLBookmarkCreationOptions(this.value); - - static CFURLBookmarkCreationOptions fromValue(int value) => switch (value) { - 512 => kCFURLBookmarkCreationMinimalBookmarkMask, - 1024 => kCFURLBookmarkCreationSuitableForBookmarkFile, - 2048 => kCFURLBookmarkCreationWithSecurityScope, - 4096 => kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess, - 536870912 => kCFURLBookmarkCreationWithoutImplicitSecurityScope, - 256 => kCFURLBookmarkCreationPreferFileIDResolutionMask, - _ => throw ArgumentError( - 'Unknown value for CFURLBookmarkCreationOptions: $value', - ), - }; +sealed class CFURLBookmarkCreationOptions { + static const kCFURLBookmarkCreationMinimalBookmarkMask = 512; + static const kCFURLBookmarkCreationSuitableForBookmarkFile = 1024; + static const kCFURLBookmarkCreationWithSecurityScope = 2048; + static const kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 4096; + static const kCFURLBookmarkCreationWithoutImplicitSecurityScope = 536870912; + static const kCFURLBookmarkCreationPreferFileIDResolutionMask = 256; } -enum CFURLBookmarkResolutionOptions { - kCFURLBookmarkResolutionWithoutUIMask(256), - kCFURLBookmarkResolutionWithoutMountingMask(512), - kCFURLBookmarkResolutionWithSecurityScope(1024), - kCFURLBookmarkResolutionWithoutImplicitStartAccessing(32768); - - static const kCFBookmarkResolutionWithoutUIMask = - kCFURLBookmarkResolutionWithoutUIMask; - static const kCFBookmarkResolutionWithoutMountingMask = - kCFURLBookmarkResolutionWithoutMountingMask; - - final int value; - const CFURLBookmarkResolutionOptions(this.value); - - static CFURLBookmarkResolutionOptions fromValue(int value) => switch (value) { - 256 => kCFURLBookmarkResolutionWithoutUIMask, - 512 => kCFURLBookmarkResolutionWithoutMountingMask, - 1024 => kCFURLBookmarkResolutionWithSecurityScope, - 32768 => kCFURLBookmarkResolutionWithoutImplicitStartAccessing, - _ => throw ArgumentError( - 'Unknown value for CFURLBookmarkResolutionOptions: $value', - ), - }; - - @override - String toString() { - if (this == kCFURLBookmarkResolutionWithoutUIMask) - return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutUIMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutUIMask"; - if (this == kCFURLBookmarkResolutionWithoutMountingMask) - return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutMountingMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutMountingMask"; - return super.toString(); - } +sealed class CFURLBookmarkResolutionOptions { + static const kCFURLBookmarkResolutionWithoutUIMask = 256; + static const kCFURLBookmarkResolutionWithoutMountingMask = 512; + static const kCFURLBookmarkResolutionWithSecurityScope = 1024; + static const kCFURLBookmarkResolutionWithoutImplicitStartAccessing = 32768; + static const kCFBookmarkResolutionWithoutUIMask = 256; + static const kCFBookmarkResolutionWithoutMountingMask = 512; } typedef CFURLBookmarkFileCreationOptions = CFOptionFlags; @@ -53498,7 +53320,7 @@ final class mach_service_port_info extends ffi.Struct { typedef mach_service_port_info_data_t = mach_service_port_info; typedef mach_service_port_info_t = ffi.Pointer; -final class UnnamedUnion1 extends ffi.Union { +final class UnnamedUnion$4 extends ffi.Union { @ffi.Array.multi([2]) external ffi.Array reserved; @@ -53517,7 +53339,7 @@ final class mach_port_options extends ffi.Struct { external mach_port_limits_t mpl; - external UnnamedUnion1 unnamed; + external UnnamedUnion$4 unnamed; } typedef mach_port_options_t = mach_port_options; @@ -53555,28 +53377,14 @@ enum CFRunLoopRunResult { }; } -enum CFRunLoopActivity { - kCFRunLoopEntry(1), - kCFRunLoopBeforeTimers(2), - kCFRunLoopBeforeSources(4), - kCFRunLoopBeforeWaiting(32), - kCFRunLoopAfterWaiting(64), - kCFRunLoopExit(128), - kCFRunLoopAllActivities(268435455); - - final int value; - const CFRunLoopActivity(this.value); - - static CFRunLoopActivity fromValue(int value) => switch (value) { - 1 => kCFRunLoopEntry, - 2 => kCFRunLoopBeforeTimers, - 4 => kCFRunLoopBeforeSources, - 32 => kCFRunLoopBeforeWaiting, - 64 => kCFRunLoopAfterWaiting, - 128 => kCFRunLoopExit, - 268435455 => kCFRunLoopAllActivities, - _ => throw ArgumentError('Unknown value for CFRunLoopActivity: $value'), - }; +sealed class CFRunLoopActivity { + static const kCFRunLoopEntry = 1; + static const kCFRunLoopBeforeTimers = 2; + static const kCFRunLoopBeforeSources = 4; + static const kCFRunLoopBeforeWaiting = 32; + static const kCFRunLoopAfterWaiting = 64; + static const kCFRunLoopExit = 128; + static const kCFRunLoopAllActivities = 268435455; } final class CFRunLoopSourceContext extends ffi.Struct { @@ -53728,141 +53536,11 @@ typedef CFRunLoopObserverCallBackFunction = typedef DartCFRunLoopObserverCallBackFunction = void Function( CFRunLoopObserverRef observer, - CFRunLoopActivity activity, + DartCFOptionFlags activity, ffi.Pointer info, ); typedef CFRunLoopObserverCallBack = ffi.Pointer>; -void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopObserverRef arg0, CFOptionFlags arg1) - > - >() - .asFunction()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) - >(_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline) - .cast(); -void -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1, -) => (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( - arg0, - arg1, -); -ffi.Pointer -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) - >(_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) - .cast(); -void -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1, -) { - (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( - arg0, - arg1, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) -> -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) - >.listener( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - CFRunLoopObserverRef arg0, - int arg1, -) { - try { - (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) -> -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) -> -_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopObserverRef, - CFOptionFlags, - ) - >.listener( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, CFOptionFlags)>`. abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { @@ -53870,7 +53548,7 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { static objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -53898,10 +53576,7 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -53918,16 +53593,15 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) > fromFunction( - void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, { + void Function(CFRunLoopObserverRef, DartCFOptionFlags) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable, - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1)), + _closureCallable, + (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive, ), retain: false, @@ -53947,15 +53621,12 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) > listener( - void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, { + void Function(CFRunLoopObserverRef, DartCFOptionFlags) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable - .nativeFunction - .cast(), - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1)), + _listenerCallable.nativeFunction.cast(), + (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(raw); @@ -53979,23 +53650,17 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) > blocking( - void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn, { + void Function(CFRunLoopObserverRef, DartCFOptionFlags) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingCallable - .nativeFunction - .cast(), - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1)), + _blockingCallable.nativeFunction.cast(), + (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_blockingListenerCallable - .nativeFunction - .cast(), - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1)), + _blockingListenerCallable.nativeFunction.cast(), + (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_tg5tbv( @@ -54009,15 +53674,136 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1, + ) { + (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( + arg0, + arg1, + ); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + CFRunLoopObserverRef arg0, + int arg1, + ) { + try { + (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( + arg0, + arg1, + ); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopObserverRef arg0, CFOptionFlags arg1) + > + >() + .asFunction()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1, + ) => + (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( + arg0, + arg1, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + CFRunLoopObserverRef, + CFOptionFlags, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, CFOptionFlags)>`. -extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_CallExtension +extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity$CallExtension on objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags) > { - void call(CFRunLoopObserverRef arg0, CFRunLoopActivity arg1) => ref + void call(CFRunLoopObserverRef arg0, DartCFOptionFlags arg1) => ref .pointer .ref .invoke @@ -54036,7 +53822,7 @@ extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_CallExtension CFRunLoopObserverRef, int, ) - >()(ref.pointer, arg0, arg1.value); + >()(ref.pointer, arg0, arg1); } final class CFRunLoopTimerContext extends ffi.Struct { @@ -54069,94 +53855,12 @@ typedef DartCFRunLoopTimerCallBackFunction = void Function(CFRunLoopTimerRef timer, ffi.Pointer info); typedef CFRunLoopTimerCallBack = ffi.Pointer>; -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline( - ffi.Pointer block, - CFRunLoopTimerRef arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) - >(_ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline( - ffi.Pointer block, - CFRunLoopTimerRef arg0, -) => (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) - >(_ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline( - ffi.Pointer block, - CFRunLoopTimerRef arg0, -) { - (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) -> -_ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) - >.listener(_ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - CFRunLoopTimerRef arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopTimerRef, - ) -> -_ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopTimerRef, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopTimerRef, - ) -> -_ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - CFRunLoopTimerRef, - ) - >.listener(_ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -54176,10 +53880,7 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { ffi.Pointer> ptr, ) => objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -54198,7 +53899,7 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { bool keepIsolateAlive = true, }) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable, + _closureCallable, (CFRunLoopTimerRef arg0) => fn(arg0), keepIsolateAlive, ), @@ -54221,8 +53922,7 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable.nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (CFRunLoopTimerRef arg0) => fn(arg0), keepIsolateAlive, ); @@ -54251,15 +53951,12 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingCallable.nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (CFRunLoopTimerRef arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (CFRunLoopTimerRef arg0) => fn(arg0), keepIsolateAlive, ); @@ -54276,10 +53973,99 @@ abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + CFRunLoopTimerRef arg0, + ) { + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + CFRunLoopTimerRef arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopTimerRef, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopTimerRef, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopTimerRef, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + CFRunLoopTimerRef, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + CFRunLoopTimerRef arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + CFRunLoopTimerRef, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + CFRunLoopTimerRef arg0, + ) => (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + CFRunLoopTimerRef, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_CFRunLoopTimerRef_CallExtension +extension ObjCBlock_ffiVoid_CFRunLoopTimerRef$CallExtension on objc.ObjCBlock)> { void call(CFRunLoopTimerRef arg0) => ref.pointer.ref.invoke .cast< @@ -54328,26 +54114,13 @@ final class CFSocketSignature extends ffi.Struct { external CFDataRef address; } -enum CFSocketCallBackType { - kCFSocketNoCallBack(0), - kCFSocketReadCallBack(1), - kCFSocketAcceptCallBack(2), - kCFSocketDataCallBack(3), - kCFSocketConnectCallBack(4), - kCFSocketWriteCallBack(8); - - final int value; - const CFSocketCallBackType(this.value); - - static CFSocketCallBackType fromValue(int value) => switch (value) { - 0 => kCFSocketNoCallBack, - 1 => kCFSocketReadCallBack, - 2 => kCFSocketAcceptCallBack, - 3 => kCFSocketDataCallBack, - 4 => kCFSocketConnectCallBack, - 8 => kCFSocketWriteCallBack, - _ => throw ArgumentError('Unknown value for CFSocketCallBackType: $value'), - }; +sealed class CFSocketCallBackType { + static const kCFSocketNoCallBack = 0; + static const kCFSocketReadCallBack = 1; + static const kCFSocketAcceptCallBack = 2; + static const kCFSocketDataCallBack = 3; + static const kCFSocketConnectCallBack = 4; + static const kCFSocketWriteCallBack = 8; } typedef CFSocketCallBackFunction = @@ -54361,7 +54134,7 @@ typedef CFSocketCallBackFunction = typedef DartCFSocketCallBackFunction = void Function( CFSocketRef s, - CFSocketCallBackType type, + DartCFOptionFlags type, CFDataRef address, ffi.Pointer data, ffi.Pointer info, @@ -54411,7 +54184,7 @@ final class fssearchblock extends ffi.Opaque {} final class searchstate extends ffi.Opaque {} -final class flock extends ffi.Struct { +final class flock$1 extends ffi.Struct { @off_t() external int l_start; @@ -54429,7 +54202,7 @@ final class flock extends ffi.Struct { } final class flocktimeout extends ffi.Struct { - external flock fl; + external flock$1 fl; external timespec timeout; } @@ -54648,26 +54421,20 @@ final class os_workgroup_join_token_opaque_s extends ffi.Struct { /// OS_os_workgroup in your config's objc-interfaces list. /// /// OS_os_workgroup -class OS_os_workgroup extends OS_object { - OS_os_workgroup._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - +extension type OS_os_workgroup._(objc.ObjCObject object$) + implements objc.ObjCObject, OS_object { /// Constructs a [OS_os_workgroup] that points to the same underlying object as [other]. - OS_os_workgroup.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + OS_os_workgroup.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [OS_os_workgroup] that wraps the given raw object pointer. - OS_os_workgroup.castFromPointer( - ffi.Pointer other, { + OS_os_workgroup.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } -typedef os_workgroup_t = ffi.Pointer; +typedef os_workgroup_t = ffi.Pointer; typedef Dartos_workgroup_t = OS_os_workgroup; typedef os_workgroup_attr_s = os_workgroup_attr_opaque_s; typedef os_workgroup_attr_t = ffi.Pointer; @@ -54690,12 +54457,12 @@ final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} typedef os_workgroup_mpt_attr_s = os_workgroup_max_parallel_threads_attr_s; typedef os_workgroup_mpt_attr_t = ffi.Pointer; -typedef os_workgroup_interval_t = ffi.Pointer; +typedef os_workgroup_interval_t = ffi.Pointer; typedef Dartos_workgroup_interval_t = OS_os_workgroup; typedef os_workgroup_interval_data_s = os_workgroup_interval_data_opaque_s; typedef os_workgroup_interval_data_t = ffi.Pointer; -typedef os_workgroup_parallel_t = ffi.Pointer; +typedef os_workgroup_parallel_t = ffi.Pointer; typedef Dartos_workgroup_parallel_t = OS_os_workgroup; typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); typedef Dartdispatch_function_tFunction = void Function(ffi.Pointer); @@ -54757,107 +54524,27 @@ enum qos_class_t { }; } -typedef dispatch_object_t = ffi.Pointer; +typedef dispatch_object_t = ffi.Pointer; typedef Dartdispatch_object_t = objc.NSObject; typedef dispatch_block_t = ffi.Pointer; typedef Dartdispatch_block_t = objc.ObjCBlock; -typedef dispatch_queue_t = ffi.Pointer; +typedef dispatch_queue_t = ffi.Pointer; typedef Dartdispatch_queue_t = objc.NSObject; -typedef dispatch_queue_global_t = ffi.Pointer; +typedef dispatch_queue_global_t = ffi.Pointer; typedef Dartdispatch_queue_global_t = objc.NSObject; -typedef dispatch_queue_serial_executor_t = ffi.Pointer; +typedef dispatch_queue_serial_executor_t = ffi.Pointer; typedef Dartdispatch_queue_serial_executor_t = objc.NSObject; -typedef dispatch_queue_serial_t = ffi.Pointer; +typedef dispatch_queue_serial_t = ffi.Pointer; typedef Dartdispatch_queue_serial_t = objc.NSObject; -typedef dispatch_queue_main_t = ffi.Pointer; +typedef dispatch_queue_main_t = ffi.Pointer; typedef Dartdispatch_queue_main_t = objc.NSObject; -typedef dispatch_queue_concurrent_t = ffi.Pointer; +typedef dispatch_queue_concurrent_t = ffi.Pointer; typedef Dartdispatch_queue_concurrent_t = objc.NSObject; -void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( - ffi.Pointer block, - int arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Size) - >(_ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer block, - int arg0, -) => (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Size) - >(_ObjCBlock_ffiVoid_ffiSize_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiSize_listenerTrampoline( - ffi.Pointer block, - int arg0, -) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable, ffi.Size)> -_ObjCBlock_ffiVoid_ffiSize_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Size) - >.listener(_ObjCBlock_ffiVoid_ffiSize_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiSize_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(int))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ) -> -_ObjCBlock_ffiVoid_ffiSize_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_ffiSize_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ) -> -_ObjCBlock_ffiVoid_ffiSize_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ) - >.listener(_ObjCBlock_ffiVoid_ffiSize_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_ffiSize { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -54875,7 +54562,7 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiSize_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -54893,7 +54580,7 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiSize_closureCallable, + _closureCallable, (int arg0) => fn(arg0), keepIsolateAlive, ), @@ -54915,7 +54602,7 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiSize_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -54943,12 +54630,12 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiSize_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiSize_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -54965,10 +54652,93 @@ abstract final class ObjCBlock_ffiVoid_ffiSize { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Size) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Size) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(int))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Size) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ) => (objc.getBlockClosure(block) as void Function(int))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Size) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_ffiSize_CallExtension +extension ObjCBlock_ffiVoid_ffiSize$CallExtension on objc.ObjCBlock { void call(int arg0) => ref.pointer.ref.invoke @@ -54990,7 +54760,7 @@ final class dispatch_queue_s extends ffi.Opaque {} typedef dispatch_queue_priority_t = ffi.Long; typedef Dartdispatch_queue_priority_t = int; -typedef dispatch_queue_attr_t = ffi.Pointer; +typedef dispatch_queue_attr_t = ffi.Pointer; typedef Dartdispatch_queue_attr_t = objc.NSObject; final class dispatch_queue_attr_s extends ffi.Opaque {} @@ -55014,28 +54784,13 @@ enum dispatch_autorelease_frequency_t { }; } -enum dispatch_block_flags_t { - DISPATCH_BLOCK_BARRIER(1), - DISPATCH_BLOCK_DETACHED(2), - DISPATCH_BLOCK_ASSIGN_CURRENT(4), - DISPATCH_BLOCK_NO_QOS_CLASS(8), - DISPATCH_BLOCK_INHERIT_QOS_CLASS(16), - DISPATCH_BLOCK_ENFORCE_QOS_CLASS(32); - - final int value; - const dispatch_block_flags_t(this.value); - - static dispatch_block_flags_t fromValue(int value) => switch (value) { - 1 => DISPATCH_BLOCK_BARRIER, - 2 => DISPATCH_BLOCK_DETACHED, - 4 => DISPATCH_BLOCK_ASSIGN_CURRENT, - 8 => DISPATCH_BLOCK_NO_QOS_CLASS, - 16 => DISPATCH_BLOCK_INHERIT_QOS_CLASS, - 32 => DISPATCH_BLOCK_ENFORCE_QOS_CLASS, - _ => throw ArgumentError( - 'Unknown value for dispatch_block_flags_t: $value', - ), - }; +sealed class dispatch_block_flags_t { + static const DISPATCH_BLOCK_BARRIER = 1; + static const DISPATCH_BLOCK_DETACHED = 2; + static const DISPATCH_BLOCK_ASSIGN_CURRENT = 4; + static const DISPATCH_BLOCK_NO_QOS_CLASS = 8; + static const DISPATCH_BLOCK_INHERIT_QOS_CLASS = 16; + static const DISPATCH_BLOCK_ENFORCE_QOS_CLASS = 32; } typedef kern_return_t = ffi.Int; @@ -55249,7 +55004,7 @@ typedef mach_msg_type_size_t = natural_t; typedef mach_msg_type_number_t = natural_t; typedef mach_msg_option_t = integer_t; typedef mach_msg_return_t = kern_return_t; -typedef dispatch_source_t = ffi.Pointer; +typedef dispatch_source_t = ffi.Pointer; typedef Dartdispatch_source_t = objc.NSObject; final class dispatch_source_type_s extends ffi.Opaque {} @@ -55267,89 +55022,24 @@ typedef dispatch_source_vnode_flags_t = ffi.UnsignedLong; typedef Dartdispatch_source_vnode_flags_t = int; typedef dispatch_source_timer_flags_t = ffi.UnsignedLong; typedef Dartdispatch_source_timer_flags_t = int; -typedef dispatch_group_t = ffi.Pointer; +typedef dispatch_group_t = ffi.Pointer; typedef Dartdispatch_group_t = objc.NSObject; -typedef dispatch_semaphore_t = ffi.Pointer; +typedef dispatch_semaphore_t = ffi.Pointer; typedef Dartdispatch_semaphore_t = objc.NSObject; typedef dispatch_once_t = ffi.IntPtr; typedef Dartdispatch_once_t = int; -typedef dispatch_data_t = ffi.Pointer; +typedef dispatch_data_t = ffi.Pointer; typedef Dartdispatch_data_t = objc.NSObject; final class dispatch_data_s extends ffi.Opaque {} -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - dispatch_data_t arg0, - ffi.Size arg1, - ffi.Pointer arg2, - ffi.Size arg3, - ) - > - >() - .asFunction< - bool Function(dispatch_data_t, int, ffi.Pointer, int) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size, - ) - >( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline, - false, - ) - .cast(); -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3, -) => - (objc.getBlockClosure(block) - as bool Function(dispatch_data_t, int, ffi.Pointer, int))( - arg0, - arg1, - arg2, - arg3, - ); -ffi.Pointer -_ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size, - ) - >( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline, - false, - ) - .cast(); - /// Construction methods for `objc.ObjCBlock, ffi.Size)>`. abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Bool Function(objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -55392,10 +55082,7 @@ abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { ffi.Size, ) >( - objc.newPointerBlock( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -55424,14 +55111,14 @@ abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { ) >( objc.newClosureBlock( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, + _closureCallable, ( dispatch_data_t arg0, int arg1, ffi.Pointer arg2, int arg3, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.fromPointer(arg0, retain: true, release: true), arg1, arg2, arg3, @@ -55441,10 +55128,67 @@ abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { retain: false, release: true, ); + + static bool _fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + dispatch_data_t arg0, + ffi.Size arg1, + ffi.Pointer arg2, + ffi.Size arg3, + ) + > + >() + .asFunction< + bool Function(dispatch_data_t, int, ffi.Pointer, int) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size, + ) + >(_fnPtrTrampoline, false) + .cast(); + static bool _closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ) => + (objc.getBlockClosure(block) + as bool Function(dispatch_data_t, int, ffi.Pointer, int))( + arg0, + arg1, + arg2, + arg3, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size, + ) + >(_closureTrampoline, false) + .cast(); } /// Call operator for `objc.ObjCBlock, ffi.Size)>`. -extension ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_CallExtension +extension ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize$CallExtension on objc.ObjCBlock< ffi.Bool Function( @@ -55494,125 +55238,11 @@ typedef Dartdispatch_data_applier_t = >; typedef dispatch_fd_t = ffi.Int; typedef Dartdispatch_fd_t = int; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) => block.ref.target - .cast< - ffi.NativeFunction - >() - .asFunction()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) => (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, - arg1, -); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) { - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, - arg1, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t, ffi.Int) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - dispatch_data_t arg0, - int arg1, -) { - try { - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -55634,10 +55264,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -55655,9 +55282,9 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable, + _closureCallable, (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.fromPointer(arg0, retain: true, release: true), arg1, ), keepIsolateAlive, @@ -55680,10 +55307,9 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable.nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, @@ -55712,20 +55338,17 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingCallable.nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, @@ -55743,148 +55366,146 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { release: true, ); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt_CallExtension - on objc.ObjCBlock { - void call(Dartdispatch_data_t arg0, int arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< + static void _listenerTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, + arg1, + ); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, ffi.Int) + > + _listenerCallable = + ffi.NativeCallable< ffi.Void Function( - ffi.Pointer block, - dispatch_data_t arg0, - ffi.Int arg1, + ffi.Pointer, + dispatch_data_t, + ffi.Int, ) - > - >() - .asFunction< - void Function(ffi.Pointer, dispatch_data_t, int) - >()(ref.pointer, arg0.ref.pointer, arg1); -} + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + dispatch_data_t arg0, + int arg1, + ) { + try { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, + arg1, + ); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) => block.ref.target - .cast< - ffi.NativeFunction - >() - .asFunction()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrCallable = - ffi.Pointer.fromFunction< + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + > + _blockingCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, + ffi.Pointer, dispatch_data_t, ffi.Int, ) - >(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) => (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, - arg1, -); -ffi.Pointer -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureCallable = - ffi.Pointer.fromFunction< + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, + ffi.Pointer, dispatch_data_t, ffi.Int, ) - >(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, -) { - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1) + > + >() + .asFunction()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) => (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( arg0, arg1, ); - objc.objectRelease(block.cast()); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >(_closureTrampoline) + .cast(); } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t, ffi.Int) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - dispatch_data_t arg0, - int arg1, -) { - try { - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt$CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t arg0, int arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + dispatch_data_t arg0, + ffi.Int arg1, + ) + > + >() + .asFunction< + void Function(ffi.Pointer, dispatch_data_t, int) + >()(ref.pointer, arg0.ref.pointer, arg1); } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ffi.Int, - ) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingTrampoline) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -55906,10 +55527,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -55928,11 +55546,11 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_closureCallable, + _closureCallable, (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: true, release: true), + : objc.NSObject.fromPointer(arg0, retain: true, release: true), arg1, ), keepIsolateAlive, @@ -55955,12 +55573,11 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_listenerCallable.nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, @@ -55989,24 +55606,21 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingCallable.nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, int arg1) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1, ), keepIsolateAlive, @@ -56024,10 +55638,126 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1 { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, + arg1, + ); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, ffi.Int) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + dispatch_data_t arg0, + int arg1, + ) { + try { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, + arg1, + ); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1) + > + >() + .asFunction()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ) => (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, + arg1, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + ffi.Int, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_CallExtension +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1$CallExtension on objc.ObjCBlock { void call(Dartdispatch_data_t? arg0, int arg1) => ref.pointer.ref.invoke .cast< @@ -56044,95 +55774,15 @@ extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt$1_CallExtension >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1); } -typedef dispatch_io_t = ffi.Pointer; +typedef dispatch_io_t = ffi.Pointer; typedef Dartdispatch_io_t = objc.NSObject; typedef dispatch_io_type_t = ffi.UnsignedLong; typedef Dartdispatch_io_type_t = int; -void _ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline( - ffi.Pointer block, - int arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Int) - >(_ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiInt_closureTrampoline( - ffi.Pointer block, - int arg0, -) => (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Int) - >(_ObjCBlock_ffiVoid_ffiInt_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiInt_listenerTrampoline( - ffi.Pointer block, - int arg0, -) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable, ffi.Int)> -_ObjCBlock_ffiVoid_ffiInt_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Int) - >.listener(_ObjCBlock_ffiVoid_ffiInt_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiInt_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(int))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_ffiInt_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_ffiInt_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_ffiInt_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ) - >.listener(_ObjCBlock_ffiVoid_ffiInt_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_ffiInt { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -56150,7 +55800,7 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiInt_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -56168,7 +55818,7 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiInt_closureCallable, + _closureCallable, (int arg0) => fn(arg0), keepIsolateAlive, ), @@ -56190,7 +55840,7 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiInt_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -56218,12 +55868,12 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiInt_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiInt_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -56240,10 +55890,93 @@ abstract final class ObjCBlock_ffiVoid_ffiInt { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Int) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Int) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(int))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Int) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ) => (objc.getBlockClosure(block) as void Function(int))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Int) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_ffiInt_CallExtension +extension ObjCBlock_ffiVoid_ffiInt$CallExtension on objc.ObjCBlock { void call(int arg0) => ref.pointer.ref.invoke @@ -56261,154 +55994,11 @@ extension ObjCBlock_ffiVoid_ffiInt_CallExtension ); } -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2) - > - >() - .asFunction()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) - >(_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2, -) => (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( - arg0, - arg1, - arg2, -); -ffi.Pointer -_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) - >(_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2, -) { - (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( - arg0, - arg1, - arg2, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) - >.listener( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - bool arg0, - dispatch_data_t arg1, - int arg2, -) { - try { - (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( - arg0, - arg1, - arg2, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) -> -_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - dispatch_data_t, - ffi.Int, - ) - >.listener( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingTrampoline, - ) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -56432,10 +56022,7 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -56454,12 +56041,12 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable, + _closureCallable, (bool arg0, dispatch_data_t arg1, int arg2) => fn( arg0, arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: true, release: true), + : objc.NSObject.fromPointer(arg1, retain: true, release: true), arg2, ), keepIsolateAlive, @@ -56483,14 +56070,12 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (bool arg0, dispatch_data_t arg1, int arg2) => fn( arg0, arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), + : objc.NSObject.fromPointer(arg1, retain: false, release: true), arg2, ), keepIsolateAlive, @@ -56520,27 +56105,23 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (bool arg0, dispatch_data_t arg1, int arg2) => fn( arg0, arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), + : objc.NSObject.fromPointer(arg1, retain: false, release: true), arg2, ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (bool arg0, dispatch_data_t arg1, int arg2) => fn( arg0, arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), + : objc.NSObject.fromPointer(arg1, retain: false, release: true), arg2, ), keepIsolateAlive, @@ -56558,10 +56139,149 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2, + ) { + (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( + arg0, + arg1, + arg2, + ); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + bool arg0, + dispatch_data_t arg1, + int arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function(bool, dispatch_data_t, int))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2, + ) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Bool arg0, + dispatch_data_t arg1, + ffi.Int arg2, + ) + > + >() + .asFunction()( + arg0, + arg1, + arg2, + ); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2, + ) => + (objc.getBlockClosure(block) + as void Function(bool, dispatch_data_t, int))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Bool, + dispatch_data_t, + ffi.Int, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_CallExtension +extension ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt$CallExtension on objc.ObjCBlock { void call(bool arg0, Dartdispatch_data_t? arg1, int arg2) => ref .pointer @@ -56594,7 +56314,7 @@ typedef dispatch_io_close_flags_t = ffi.UnsignedLong; typedef Dartdispatch_io_close_flags_t = int; typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; typedef Dartdispatch_io_interval_flags_t = int; -typedef dispatch_workloop_t = ffi.Pointer; +typedef dispatch_workloop_t = ffi.Pointer; typedef Dartdispatch_workloop_t = objc.NSObject; final class CFStreamError extends ffi.Struct { @@ -56633,26 +56353,13 @@ enum CFStreamStatus { }; } -enum CFStreamEventType { - kCFStreamEventNone(0), - kCFStreamEventOpenCompleted(1), - kCFStreamEventHasBytesAvailable(2), - kCFStreamEventCanAcceptBytes(4), - kCFStreamEventErrorOccurred(8), - kCFStreamEventEndEncountered(16); - - final int value; - const CFStreamEventType(this.value); - - static CFStreamEventType fromValue(int value) => switch (value) { - 0 => kCFStreamEventNone, - 1 => kCFStreamEventOpenCompleted, - 2 => kCFStreamEventHasBytesAvailable, - 4 => kCFStreamEventCanAcceptBytes, - 8 => kCFStreamEventErrorOccurred, - 16 => kCFStreamEventEndEncountered, - _ => throw ArgumentError('Unknown value for CFStreamEventType: $value'), - }; +sealed class CFStreamEventType { + static const kCFStreamEventNone = 0; + static const kCFStreamEventOpenCompleted = 1; + static const kCFStreamEventHasBytesAvailable = 2; + static const kCFStreamEventCanAcceptBytes = 4; + static const kCFStreamEventErrorOccurred = 8; + static const kCFStreamEventEndEncountered = 16; } final class CFStreamClientContext extends ffi.Struct { @@ -56695,7 +56402,7 @@ typedef CFReadStreamClientCallBackFunction = typedef DartCFReadStreamClientCallBackFunction = void Function( CFReadStreamRef stream, - CFStreamEventType type, + DartCFOptionFlags type, ffi.Pointer clientCallBackInfo, ); typedef CFReadStreamClientCallBack = @@ -56709,7 +56416,7 @@ typedef CFWriteStreamClientCallBackFunction = typedef DartCFWriteStreamClientCallBackFunction = void Function( CFWriteStreamRef stream, - CFStreamEventType type, + DartCFOptionFlags type, ffi.Pointer clientCallBackInfo, ); typedef CFWriteStreamClientCallBack = @@ -57059,32 +56766,15 @@ final class __CFURLEnumerator extends ffi.Opaque {} typedef CFURLEnumeratorRef = ffi.Pointer<__CFURLEnumerator>; -enum CFURLEnumeratorOptions { - kCFURLEnumeratorDefaultBehavior(0), - kCFURLEnumeratorDescendRecursively(1), - kCFURLEnumeratorSkipInvisibles(2), - kCFURLEnumeratorGenerateFileReferenceURLs(4), - kCFURLEnumeratorSkipPackageContents(8), - kCFURLEnumeratorIncludeDirectoriesPreOrder(16), - kCFURLEnumeratorIncludeDirectoriesPostOrder(32), - kCFURLEnumeratorGenerateRelativePathURLs(64); - - final int value; - const CFURLEnumeratorOptions(this.value); - - static CFURLEnumeratorOptions fromValue(int value) => switch (value) { - 0 => kCFURLEnumeratorDefaultBehavior, - 1 => kCFURLEnumeratorDescendRecursively, - 2 => kCFURLEnumeratorSkipInvisibles, - 4 => kCFURLEnumeratorGenerateFileReferenceURLs, - 8 => kCFURLEnumeratorSkipPackageContents, - 16 => kCFURLEnumeratorIncludeDirectoriesPreOrder, - 32 => kCFURLEnumeratorIncludeDirectoriesPostOrder, - 64 => kCFURLEnumeratorGenerateRelativePathURLs, - _ => throw ArgumentError( - 'Unknown value for CFURLEnumeratorOptions: $value', - ), - }; +sealed class CFURLEnumeratorOptions { + static const kCFURLEnumeratorDefaultBehavior = 0; + static const kCFURLEnumeratorDescendRecursively = 1; + static const kCFURLEnumeratorSkipInvisibles = 2; + static const kCFURLEnumeratorGenerateFileReferenceURLs = 4; + static const kCFURLEnumeratorSkipPackageContents = 8; + static const kCFURLEnumeratorIncludeDirectoriesPreOrder = 16; + static const kCFURLEnumeratorIncludeDirectoriesPostOrder = 32; + static const kCFURLEnumeratorGenerateRelativePathURLs = 64; } enum CFURLEnumeratorResult { @@ -57369,58 +57059,27 @@ final class __CFFileSecurity extends ffi.Opaque {} typedef CFFileSecurityRef = ffi.Pointer<__CFFileSecurity>; -enum CFFileSecurityClearOptions { - kCFFileSecurityClearOwner(1), - kCFFileSecurityClearGroup(2), - kCFFileSecurityClearMode(4), - kCFFileSecurityClearOwnerUUID(8), - kCFFileSecurityClearGroupUUID(16), - kCFFileSecurityClearAccessControlList(32); - - final int value; - const CFFileSecurityClearOptions(this.value); - - static CFFileSecurityClearOptions fromValue(int value) => switch (value) { - 1 => kCFFileSecurityClearOwner, - 2 => kCFFileSecurityClearGroup, - 4 => kCFFileSecurityClearMode, - 8 => kCFFileSecurityClearOwnerUUID, - 16 => kCFFileSecurityClearGroupUUID, - 32 => kCFFileSecurityClearAccessControlList, - _ => throw ArgumentError( - 'Unknown value for CFFileSecurityClearOptions: $value', - ), - }; +sealed class CFFileSecurityClearOptions { + static const kCFFileSecurityClearOwner = 1; + static const kCFFileSecurityClearGroup = 2; + static const kCFFileSecurityClearMode = 4; + static const kCFFileSecurityClearOwnerUUID = 8; + static const kCFFileSecurityClearGroupUUID = 16; + static const kCFFileSecurityClearAccessControlList = 32; } final class __CFStringTokenizer extends ffi.Opaque {} typedef CFStringTokenizerRef = ffi.Pointer<__CFStringTokenizer>; -enum CFStringTokenizerTokenType { - kCFStringTokenizerTokenNone(0), - kCFStringTokenizerTokenNormal(1), - kCFStringTokenizerTokenHasSubTokensMask(2), - kCFStringTokenizerTokenHasDerivedSubTokensMask(4), - kCFStringTokenizerTokenHasHasNumbersMask(8), - kCFStringTokenizerTokenHasNonLettersMask(16), - kCFStringTokenizerTokenIsCJWordMask(32); - - final int value; - const CFStringTokenizerTokenType(this.value); - - static CFStringTokenizerTokenType fromValue(int value) => switch (value) { - 0 => kCFStringTokenizerTokenNone, - 1 => kCFStringTokenizerTokenNormal, - 2 => kCFStringTokenizerTokenHasSubTokensMask, - 4 => kCFStringTokenizerTokenHasDerivedSubTokensMask, - 8 => kCFStringTokenizerTokenHasHasNumbersMask, - 16 => kCFStringTokenizerTokenHasNonLettersMask, - 32 => kCFStringTokenizerTokenIsCJWordMask, - _ => throw ArgumentError( - 'Unknown value for CFStringTokenizerTokenType: $value', - ), - }; +sealed class CFStringTokenizerTokenType { + static const kCFStringTokenizerTokenNone = 0; + static const kCFStringTokenizerTokenNormal = 1; + static const kCFStringTokenizerTokenHasSubTokensMask = 2; + static const kCFStringTokenizerTokenHasDerivedSubTokensMask = 4; + static const kCFStringTokenizerTokenHasHasNumbersMask = 8; + static const kCFStringTokenizerTokenHasNonLettersMask = 16; + static const kCFStringTokenizerTokenIsCJWordMask = 32; } typedef CFFileDescriptorNativeDescriptor = ffi.Int; @@ -57631,50 +57290,25 @@ final class __CFXMLParser extends ffi.Opaque {} typedef CFXMLParserRef = ffi.Pointer<__CFXMLParser>; -enum CFXMLParserStatusCode { - kCFXMLStatusParseNotBegun(-2), - kCFXMLStatusParseInProgress(-1), - kCFXMLStatusParseSuccessful(0), - kCFXMLErrorUnexpectedEOF(1), - kCFXMLErrorUnknownEncoding(2), - kCFXMLErrorEncodingConversionFailure(3), - kCFXMLErrorMalformedProcessingInstruction(4), - kCFXMLErrorMalformedDTD(5), - kCFXMLErrorMalformedName(6), - kCFXMLErrorMalformedCDSect(7), - kCFXMLErrorMalformedCloseTag(8), - kCFXMLErrorMalformedStartTag(9), - kCFXMLErrorMalformedDocument(10), - kCFXMLErrorElementlessDocument(11), - kCFXMLErrorMalformedComment(12), - kCFXMLErrorMalformedCharacterReference(13), - kCFXMLErrorMalformedParsedCharacterData(14), - kCFXMLErrorNoData(15); - - final int value; - const CFXMLParserStatusCode(this.value); - - static CFXMLParserStatusCode fromValue(int value) => switch (value) { - -2 => kCFXMLStatusParseNotBegun, - -1 => kCFXMLStatusParseInProgress, - 0 => kCFXMLStatusParseSuccessful, - 1 => kCFXMLErrorUnexpectedEOF, - 2 => kCFXMLErrorUnknownEncoding, - 3 => kCFXMLErrorEncodingConversionFailure, - 4 => kCFXMLErrorMalformedProcessingInstruction, - 5 => kCFXMLErrorMalformedDTD, - 6 => kCFXMLErrorMalformedName, - 7 => kCFXMLErrorMalformedCDSect, - 8 => kCFXMLErrorMalformedCloseTag, - 9 => kCFXMLErrorMalformedStartTag, - 10 => kCFXMLErrorMalformedDocument, - 11 => kCFXMLErrorElementlessDocument, - 12 => kCFXMLErrorMalformedComment, - 13 => kCFXMLErrorMalformedCharacterReference, - 14 => kCFXMLErrorMalformedParsedCharacterData, - 15 => kCFXMLErrorNoData, - _ => throw ArgumentError('Unknown value for CFXMLParserStatusCode: $value'), - }; +sealed class CFXMLParserStatusCode { + static const kCFXMLStatusParseNotBegun = -2; + static const kCFXMLStatusParseInProgress = -1; + static const kCFXMLStatusParseSuccessful = 0; + static const kCFXMLErrorUnexpectedEOF = 1; + static const kCFXMLErrorUnknownEncoding = 2; + static const kCFXMLErrorEncodingConversionFailure = 3; + static const kCFXMLErrorMalformedProcessingInstruction = 4; + static const kCFXMLErrorMalformedDTD = 5; + static const kCFXMLErrorMalformedName = 6; + static const kCFXMLErrorMalformedCDSect = 7; + static const kCFXMLErrorMalformedCloseTag = 8; + static const kCFXMLErrorMalformedStartTag = 9; + static const kCFXMLErrorMalformedDocument = 10; + static const kCFXMLErrorElementlessDocument = 11; + static const kCFXMLErrorMalformedComment = 12; + static const kCFXMLErrorMalformedCharacterReference = 13; + static const kCFXMLErrorMalformedParsedCharacterData = 14; + static const kCFXMLErrorNoData = 15; } typedef CFXMLParserCreateXMLStructureCallBackFunction = @@ -57736,7 +57370,7 @@ typedef CFXMLParserHandleErrorCallBackFunction = typedef DartCFXMLParserHandleErrorCallBackFunction = DartBoolean Function( CFXMLParserRef parser, - CFXMLParserStatusCode error, + DartCFIndex error, ffi.Pointer info, ); typedef CFXMLParserHandleErrorCallBack = @@ -57990,7 +57624,7 @@ final class cssm_list extends ffi.Struct { typedef CSSM_LIST = cssm_list; -final class UnnamedUnion2 extends ffi.Union { +final class UnnamedUnion$1 extends ffi.Union { external CSSM_LIST Sublist; external SecAsn1Item Word; @@ -58005,7 +57639,7 @@ final class cssm_list_element extends ffi.Struct { @CSSM_LIST_ELEMENT_TYPE() external int ElementType; - external UnnamedUnion2 Element; + external UnnamedUnion$1 Element; } typedef CSSM_LIST_PTR = ffi.Pointer; @@ -58180,7 +57814,7 @@ typedef CSSM_CERT_PAIR_PTR = ffi.Pointer; typedef CSSM_CERTGROUP_TYPE = uint32; typedef CSSM_CERTGROUP_TYPE_PTR = ffi.Pointer; -final class UnnamedUnion3 extends ffi.Union { +final class UnnamedUnion$2 extends ffi.Union { external CSSM_DATA_PTR CertList; external CSSM_ENCODED_CERT_PTR EncodedCertList; @@ -58200,7 +57834,7 @@ final class cssm_certgroup extends ffi.Struct { @uint32() external int NumCerts; - external UnnamedUnion3 GroupList; + external UnnamedUnion$2 GroupList; @CSSM_CERTGROUP_TYPE() external int CertGroupType; @@ -58785,7 +58419,7 @@ typedef CSSM_CRL_PAIR_PTR = ffi.Pointer; typedef CSSM_CRLGROUP_TYPE = uint32; typedef CSSM_CRLGROUP_TYPE_PTR = ffi.Pointer; -final class UnnamedUnion4 extends ffi.Union { +final class UnnamedUnion$3 extends ffi.Union { external CSSM_DATA_PTR CrlList; external CSSM_ENCODED_CRL_PTR EncodedCrlList; @@ -58805,7 +58439,7 @@ final class cssm_crlgroup extends ffi.Struct { @uint32() external int NumberOfCrls; - external UnnamedUnion4 GroupCrlList; + external UnnamedUnion$3 GroupCrlList; @CSSM_CRLGROUP_TYPE() external int CrlGroupType; @@ -59406,7 +59040,7 @@ final class cssm_x509_time extends ffi.Struct { @CSSM_BER_TAG() external int timeType; - external SecAsn1Item time; + external SecAsn1Item time$1; } typedef CSSM_X509_TIME = cssm_x509_time; @@ -59787,7 +59421,7 @@ enum __CE_CrlDistributionPointNameType { }; } -final class UnnamedUnion5 extends ffi.Union { +final class UnnamedUnion extends ffi.Union { external ffi.Pointer fullName; external CSSM_X509_RDN_PTR rdn; @@ -59800,7 +59434,7 @@ final class __CE_DistributionPointName extends ffi.Struct { __CE_CrlDistributionPointNameType get nameType => __CE_CrlDistributionPointNameType.fromValue(nameTypeAsInt); - external UnnamedUnion5 dpn; + external UnnamedUnion dpn; } typedef CE_DistributionPointName = __CE_DistributionPointName; @@ -60080,7 +59714,7 @@ final class __CE_DataAndType extends ffi.Struct { __CE_DataType get type => __CE_DataType.fromValue(typeAsInt); - external CE_Data extension$; + external CE_Data extension; @CSSM_BOOL() external int critical; @@ -60338,130 +59972,12 @@ enum SecTrustResultType { final class __SecTrust extends ffi.Opaque {} typedef SecTrustRef = ffi.Pointer<__SecTrust>; -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - int arg1, -) => block.ref.target - .cast< - ffi.NativeFunction - >() - .asFunction()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) - >(_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - int arg1, -) => (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( - arg0, - arg1, -); -ffi.Pointer -_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) - >(_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - int arg1, -) { - (objc.getBlockClosure(block) as void Function(SecTrustRef, int))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, SecTrustRef, ffi.Uint32) -> -_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) - >.listener( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - SecTrustRef arg0, - int arg1, -) { - try { - (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) -> -_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) -> -_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Uint32, - ) - >.listener( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, ffi.Uint32)>`. abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock, ffi.Uint32)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -60483,10 +59999,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { > ptr, ) => objc.ObjCBlock, ffi.Uint32)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -60505,7 +60018,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { bool keepIsolateAlive = true, }) => objc.ObjCBlock, ffi.Uint32)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable, + _closureCallable, (SecTrustRef arg0, int arg1) => fn(arg0, SecTrustResultType.fromValue(arg1)), keepIsolateAlive, @@ -60529,9 +60042,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (SecTrustRef arg0, int arg1) => fn(arg0, SecTrustResultType.fromValue(arg1)), keepIsolateAlive, @@ -60559,17 +60070,13 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (SecTrustRef arg0, int arg1) => fn(arg0, SecTrustResultType.fromValue(arg1)), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (SecTrustRef arg0, int arg1) => fn(arg0, SecTrustResultType.fromValue(arg1)), keepIsolateAlive, @@ -60585,10 +60092,124 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + int arg1, + ) { + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( + arg0, + arg1, + ); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, SecTrustRef, ffi.Uint32) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + SecTrustRef arg0, + int arg1, + ) { + try { + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( + arg0, + arg1, + ); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + int arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction + >() + .asFunction()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + int arg1, + ) => (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( + arg0, + arg1, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Uint32, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, ffi.Uint32)>`. -extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_CallExtension +extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType$CallExtension on objc.ObjCBlock, ffi.Uint32)> { void call(SecTrustRef arg0, SecTrustResultType arg1) => ref.pointer.ref.invoke .cast< @@ -60608,148 +60229,6 @@ extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_CallExtension typedef SecTrustCallback = ffi.Pointer; typedef DartSecTrustCallback = objc.ObjCBlock, ffi.Uint32)>; -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2, -) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2) - > - >() - .asFunction()( - arg0, - arg1, - arg2, - ); -ffi.Pointer -_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) - >(_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2, -) => - (objc.getBlockClosure(block) - as void Function(SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) - >(_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2, -) { - (objc.getBlockClosure(block) as void Function(SecTrustRef, bool, CFErrorRef))( - arg0, - arg1, - arg2, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) -> -_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) - >.listener( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function(SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) -> -_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) -> -_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - SecTrustRef, - ffi.Bool, - CFErrorRef, - ) - >.listener( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { @@ -60757,7 +60236,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { static objc.ObjCBlock< ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -60793,10 +60272,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { ffi.Pointer<__CFError>, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -60824,7 +60300,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable, + _closureCallable, (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), keepIsolateAlive, @@ -60850,9 +60326,7 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), keepIsolateAlive, ); @@ -60885,16 +60359,12 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2), keepIsolateAlive, ); @@ -60913,10 +60383,146 @@ abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2, + ) { + (objc.getBlockClosure(block) + as void Function(SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function(SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2, + ) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + SecTrustRef arg0, + ffi.Bool arg1, + CFErrorRef arg2, + ) + > + >() + .asFunction()( + arg0, + arg1, + arg2, + ); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2, + ) => + (objc.getBlockClosure(block) + as void Function(SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + SecTrustRef, + ffi.Bool, + CFErrorRef, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. -extension ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_CallExtension +extension ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -60959,28 +60565,14 @@ typedef DartSecTrustWithErrorCallback = ) >; -enum SecTrustOptionFlags { - kSecTrustOptionAllowExpired(1), - kSecTrustOptionLeafIsCA(2), - kSecTrustOptionFetchIssuerFromNet(4), - kSecTrustOptionAllowExpiredRoot(8), - kSecTrustOptionRequireRevPerCert(16), - kSecTrustOptionUseTrustSettings(32), - kSecTrustOptionImplicitAnchors(64); - - final int value; - const SecTrustOptionFlags(this.value); - - static SecTrustOptionFlags fromValue(int value) => switch (value) { - 1 => kSecTrustOptionAllowExpired, - 2 => kSecTrustOptionLeafIsCA, - 4 => kSecTrustOptionFetchIssuerFromNet, - 8 => kSecTrustOptionAllowExpiredRoot, - 16 => kSecTrustOptionRequireRevPerCert, - 32 => kSecTrustOptionUseTrustSettings, - 64 => kSecTrustOptionImplicitAnchors, - _ => throw ArgumentError('Unknown value for SecTrustOptionFlags: $value'), - }; +sealed class SecTrustOptionFlags { + static const kSecTrustOptionAllowExpired = 1; + static const kSecTrustOptionLeafIsCA = 2; + static const kSecTrustOptionFetchIssuerFromNet = 4; + static const kSecTrustOptionAllowExpiredRoot = 8; + static const kSecTrustOptionRequireRevPerCert = 16; + static const kSecTrustOptionUseTrustSettings = 32; + static const kSecTrustOptionImplicitAnchors = 64; } typedef SSLCipherSuite = ffi.Uint16; @@ -61006,11 +60598,11 @@ enum SSLCiphersuiteGroup { }; } -typedef sec_trust_t = ffi.Pointer; +typedef sec_trust_t = ffi.Pointer; typedef Dartsec_trust_t = objc.NSObject; -typedef sec_identity_t = ffi.Pointer; +typedef sec_identity_t = ffi.Pointer; typedef Dartsec_identity_t = objc.NSObject; -typedef sec_certificate_t = ffi.Pointer; +typedef sec_certificate_t = ffi.Pointer; typedef Dartsec_certificate_t = objc.NSObject; enum tls_protocol_version_t { @@ -61157,93 +60749,10 @@ enum SSLProtocol { }; } -void _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline( - ffi.Pointer block, - sec_certificate_t arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, sec_certificate_t) - >(_ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline( - ffi.Pointer block, - sec_certificate_t arg0, -) => (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, sec_certificate_t) - >(_ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline( - ffi.Pointer block, - sec_certificate_t arg0, -) { - (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, sec_certificate_t) -> -_ObjCBlock_ffiVoid_seccertificatet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, sec_certificate_t) - >.listener(_ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_seccertificatet_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - sec_certificate_t arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_certificate_t, - ) -> -_ObjCBlock_ffiVoid_seccertificatet_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_certificate_t, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_seccertificatet_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_certificate_t, - ) -> -_ObjCBlock_ffiVoid_seccertificatet_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_certificate_t, - ) - >.listener(_ObjCBlock_ffiVoid_seccertificatet_blockingTrampoline) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_seccertificatet { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -61262,10 +60771,7 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -61283,9 +60789,9 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_closureCallable, + _closureCallable, (sec_certificate_t arg0) => - fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true)), + fn(objc.NSObject.fromPointer(arg0, retain: true, release: true)), keepIsolateAlive, ), retain: false, @@ -61306,9 +60812,9 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (sec_certificate_t arg0) => - fn(objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + fn(objc.NSObject.fromPointer(arg0, retain: false, release: true)), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); @@ -61335,16 +60841,15 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (sec_certificate_t arg0) => - fn(objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + fn(objc.NSObject.fromPointer(arg0, retain: false, release: true)), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_blockingListenerCallable.nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (sec_certificate_t arg0) => - fn(objc.NSObject.castFromPointer(arg0, retain: false, release: true)), + fn(objc.NSObject.fromPointer(arg0, retain: false, release: true)), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( @@ -61360,10 +60865,99 @@ abstract final class ObjCBlock_ffiVoid_seccertificatet { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + sec_certificate_t arg0, + ) { + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, sec_certificate_t) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, sec_certificate_t) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + sec_certificate_t arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_certificate_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_certificate_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_certificate_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_certificate_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + sec_certificate_t arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_certificate_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + sec_certificate_t arg0, + ) => (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_certificate_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_seccertificatet_CallExtension +extension ObjCBlock_ffiVoid_seccertificatet$CallExtension on objc.ObjCBlock { void call(Dartsec_certificate_t arg0) => ref.pointer.ref.invoke .cast< @@ -61379,95 +60973,13 @@ extension ObjCBlock_ffiVoid_seccertificatet_CallExtension >()(ref.pointer, arg0.ref.pointer); } -typedef sec_protocol_metadata_t = ffi.Pointer; +typedef sec_protocol_metadata_t = ffi.Pointer; typedef Dartsec_protocol_metadata_t = objc.NSObject; -void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( - ffi.Pointer block, - int arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_Uint16_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Uint16) - >(_ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_Uint16_closureTrampoline( - ffi.Pointer block, - int arg0, -) => (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_Uint16_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Uint16) - >(_ObjCBlock_ffiVoid_Uint16_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_Uint16_listenerTrampoline( - ffi.Pointer block, - int arg0, -) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Uint16) -> -_ObjCBlock_ffiVoid_Uint16_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Uint16) - >.listener(_ObjCBlock_ffiVoid_Uint16_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_Uint16_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(int))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ) -> -_ObjCBlock_ffiVoid_Uint16_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_Uint16_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ) -> -_ObjCBlock_ffiVoid_Uint16_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ) - >.listener(_ObjCBlock_ffiVoid_Uint16_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_Uint16 { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -61485,7 +60997,7 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_Uint16_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -61503,7 +61015,7 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_Uint16_closureCallable, + _closureCallable, (int arg0) => fn(arg0), keepIsolateAlive, ), @@ -61525,7 +61037,7 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_Uint16_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -61553,12 +61065,12 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_Uint16_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_Uint16_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), (int arg0) => fn(arg0), keepIsolateAlive, ); @@ -61575,10 +61087,93 @@ abstract final class ObjCBlock_ffiVoid_Uint16 { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Uint16) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Uint16) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(int))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint16) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ) => (objc.getBlockClosure(block) as void Function(int))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint16) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_Uint16_CallExtension +extension ObjCBlock_ffiVoid_Uint16$CallExtension on objc.ObjCBlock { void call(int arg0) => ref.pointer.ref.invoke @@ -61596,134 +61191,11 @@ extension ObjCBlock_ffiVoid_Uint16_CallExtension ); } -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(dispatch_data_t arg0, dispatch_data_t arg1) - > - >() - .asFunction()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) - >(_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1, -) => - (objc.getBlockClosure(block) - as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) - >(_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1, -) { - (objc.getBlockClosure(block) - as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) - >.listener( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - dispatch_data_t arg0, - dispatch_data_t arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - dispatch_data_t, - ) - >.listener( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingTrampoline, - ) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -61747,10 +61219,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -61769,10 +61238,10 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable, + _closureCallable, (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true), + objc.NSObject.fromPointer(arg0, retain: true, release: true), + objc.NSObject.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -61795,12 +61264,10 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -61829,22 +61296,18 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -61861,10 +61324,129 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1, + ) { + (objc.getBlockClosure(block) + as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + dispatch_data_t arg0, + dispatch_data_t arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1, + ) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, dispatch_data_t arg1) + > + >() + .asFunction()( + arg0, + arg1, + ); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1, + ) => + (objc.getBlockClosure(block) + as void Function(dispatch_data_t, dispatch_data_t))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + dispatch_data_t, + dispatch_data_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension +extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat$CallExtension on objc.ObjCBlock { void call(Dartdispatch_data_t arg0, Dartdispatch_data_t arg1) => ref .pointer @@ -61888,95 +61470,13 @@ extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -typedef sec_protocol_options_t = ffi.Pointer; +typedef sec_protocol_options_t = ffi.Pointer; typedef Dartsec_protocol_options_t = objc.NSObject; -void _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, dispatch_data_t) - >(_ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, -) => (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, dispatch_data_t) - >(_ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_listenerTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, -) { - (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t) -> -_ObjCBlock_ffiVoid_dispatchdatat_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_dispatchdatat_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - dispatch_data_t arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_dispatchdatat_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ) -> -_ObjCBlock_ffiVoid_dispatchdatat_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - dispatch_data_t, - ) - >.listener(_ObjCBlock_ffiVoid_dispatchdatat_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_dispatchdatat { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -61995,10 +61495,7 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -62016,11 +61513,11 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_closureCallable, + _closureCallable, (dispatch_data_t arg0) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: true, release: true), + : objc.NSObject.fromPointer(arg0, retain: true, release: true), ), keepIsolateAlive, ), @@ -62042,11 +61539,11 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (dispatch_data_t arg0) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -62074,21 +61571,20 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (dispatch_data_t arg0) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_blockingListenerCallable.nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (dispatch_data_t arg0) => fn( arg0.address == 0 ? null - : objc.NSObject.castFromPointer(arg0, retain: false, release: true), + : objc.NSObject.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -62105,10 +61601,93 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + ) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + dispatch_data_t arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + dispatch_data_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, dispatch_data_t) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + ) => (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, dispatch_data_t) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_CallExtension +extension ObjCBlock_ffiVoid_dispatchdatat$CallExtension on objc.ObjCBlock { void call(Dartdispatch_data_t? arg0) => ref.pointer.ref.invoke .cast< @@ -62128,170 +61707,6 @@ typedef sec_protocol_pre_shared_key_selection_complete_t = ffi.Pointer; typedef Dartsec_protocol_pre_shared_key_selection_complete_t = objc.ObjCBlock; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2, - ) - > - >() - .asFunction< - void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2, -) => - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2, -) { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet { @@ -62303,7 +61718,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -62347,10 +61762,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -62387,21 +61799,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable, + _closureCallable, ( sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.fromPointer(arg0, retain: true, release: true), arg1.address == 0 ? null - : objc.NSObject.castFromPointer( - arg1, - retain: true, - release: true, - ), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + : objc.NSObject.fromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg2, retain: true, release: true, @@ -62439,19 +61847,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + : objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg2, retain: false, release: true, @@ -62497,19 +61903,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + : objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg2, retain: false, release: true, @@ -62518,19 +61922,17 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + : objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg2, retain: false, release: true, @@ -62553,10 +61955,159 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secpro ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2, + ) + > + >() + .asFunction< + void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_CallExtension +extension ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -62609,150 +62160,6 @@ typedef Dartsec_protocol_pre_shared_key_selection_t = typedef sec_protocol_key_update_complete_t = ffi.Pointer; typedef Dartsec_protocol_key_update_complete_t = objc.ObjCBlock; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1, - ) - > - >() - .asFunction< - void Function(sec_protocol_metadata_t, sec_protocol_key_update_complete_t) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1, -) => - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1, -) { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet { @@ -62760,7 +62167,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate static objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.ObjCBlock) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -62791,10 +62198,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.ObjCBlock) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -62822,17 +62226,13 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate ffi.Void Function(objc.NSObject, objc.ObjCBlock) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable, + _closureCallable, ( sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid.castFromPointer( - arg1, - retain: true, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -62861,17 +62261,11 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid.castFromPointer( - arg1, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -62904,32 +62298,20 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid.castFromPointer( - arg1, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid.castFromPointer( - arg1, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -62944,10 +62326,142 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdate ffi.Void Function(objc.NSObject, objc.ObjCBlock) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1, + ) + > + >() + .asFunction< + void Function( + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_CallExtension +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet$CallExtension on objc.ObjCBlock< ffi.Void Function(objc.NSObject, objc.ObjCBlock) @@ -62982,150 +62496,6 @@ typedef Dartsec_protocol_key_update_t = typedef sec_protocol_challenge_complete_t = ffi.Pointer; typedef Dartsec_protocol_challenge_complete_t = objc.ObjCBlock; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1, - ) - > - >() - .asFunction< - void Function(sec_protocol_metadata_t, sec_protocol_challenge_complete_t) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1, -) => - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1, -) { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet { @@ -63136,7 +62506,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -63176,10 +62546,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -63213,13 +62580,13 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable, + _closureCallable, ( sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + objc.NSObject.fromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg1, retain: true, release: true, @@ -63255,13 +62622,11 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg1, retain: false, release: true, @@ -63304,13 +62669,11 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg1, retain: false, release: true, @@ -63319,13 +62682,11 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - ObjCBlock_ffiVoid_dispatchdatat.castFromPointer( + objc.NSObject.fromPointer(arg0, retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.fromPointer( arg1, retain: false, release: true, @@ -63347,10 +62708,142 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallenge ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1, + ) + > + >() + .asFunction< + void Function( + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_CallExtension +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -63388,91 +62881,11 @@ typedef Dartsec_protocol_challenge_t = objc.ObjCBlock, ) >; -void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( - ffi.Pointer block, - bool arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Bool) - >(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_closureTrampoline( - ffi.Pointer block, - bool arg0, -) => (objc.getBlockClosure(block) as void Function(bool))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Bool) - >(_ObjCBlock_ffiVoid_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_listenerTrampoline( - ffi.Pointer block, - bool arg0, -) { - (objc.getBlockClosure(block) as void Function(bool))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable, ffi.Bool)> -_ObjCBlock_ffiVoid_bool_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Bool) - >.listener(_ObjCBlock_ffiVoid_bool_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_bool_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - bool arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(bool))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) -> -_ObjCBlock_ffiVoid_bool_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_bool_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) -> -_ObjCBlock_ffiVoid_bool_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) - >.listener(_ObjCBlock_ffiVoid_bool_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_bool { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -63490,7 +62903,7 @@ abstract final class ObjCBlock_ffiVoid_bool { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_bool_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -63508,7 +62921,7 @@ abstract final class ObjCBlock_ffiVoid_bool { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_closureCallable, + _closureCallable, (bool arg0) => fn(arg0), keepIsolateAlive, ), @@ -63530,7 +62943,7 @@ abstract final class ObjCBlock_ffiVoid_bool { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (bool arg0) => fn(arg0), keepIsolateAlive, ); @@ -63558,12 +62971,12 @@ abstract final class ObjCBlock_ffiVoid_bool { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (bool arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), (bool arg0) => fn(arg0), keepIsolateAlive, ); @@ -63580,10 +62993,93 @@ abstract final class ObjCBlock_ffiVoid_bool { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + bool arg0, + ) { + (objc.getBlockClosure(block) as void Function(bool))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + bool arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(bool))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + bool arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + bool arg0, + ) => (objc.getBlockClosure(block) as void Function(bool))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_bool_CallExtension +extension ObjCBlock_ffiVoid_bool$CallExtension on objc.ObjCBlock { void call(bool arg0) => ref.pointer.ref.invoke @@ -63604,170 +63100,6 @@ extension ObjCBlock_ffiVoid_bool_CallExtension typedef sec_protocol_verify_complete_t = ffi.Pointer; typedef Dartsec_protocol_verify_complete_t = objc.ObjCBlock; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2, - ) - > - >() - .asFunction< - void Function( - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2, -) => - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2, -) { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) -> -_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t, - ) - >.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet { @@ -63779,7 +63111,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -63823,10 +63155,7 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -63863,15 +63192,15 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable, + _closureCallable, ( sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer( + objc.NSObject.fromPointer(arg0, retain: true, release: true), + objc.NSObject.fromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_bool.fromPointer( arg2, retain: true, release: true, @@ -63909,21 +63238,15 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer( - arg2, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_bool.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -63965,40 +63288,28 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer( - arg2, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_bool.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2, ) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer( - arg2, - retain: false, - release: true, - ), + objc.NSObject.fromPointer(arg0, retain: false, release: true), + objc.NSObject.fromPointer(arg1, retain: false, release: true), + ObjCBlock_ffiVoid_bool.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -64017,10 +63328,159 @@ abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotoco ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2, + ) + > + >() + .asFunction< + void Function( + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_CallExtension +extension ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -64211,1971 +63671,773 @@ enum SSLAuthenticate { } late final _class_NSURLSession = objc.getClass("NSURLSession"); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target +late final _sel_sharedSession = objc.registerName("sharedSession"); +late final _class_NSURLSessionConfiguration = objc.getClass( + "NSURLSessionConfiguration", +); +late final _sel_defaultSessionConfiguration = objc.registerName( + "defaultSessionConfiguration", +); +late final _sel_ephemeralSessionConfiguration = objc.registerName( + "ephemeralSessionConfiguration", +); +late final _sel_backgroundSessionConfigurationWithIdentifier_ = objc + .registerName("backgroundSessionConfigurationWithIdentifier:"); +late final _sel_identifier = objc.registerName("identifier"); +late final _sel_requestCachePolicy = objc.registerName("requestCachePolicy"); +late final _sel_setRequestCachePolicy_ = objc.registerName( + "setRequestCachePolicy:", +); +late final _sel_timeoutIntervalForRequest = objc.registerName( + "timeoutIntervalForRequest", +); +late final _sel_setTimeoutIntervalForRequest_ = objc.registerName( + "setTimeoutIntervalForRequest:", +); +late final _sel_timeoutIntervalForResource = objc.registerName( + "timeoutIntervalForResource", +); +late final _sel_setTimeoutIntervalForResource_ = objc.registerName( + "setTimeoutIntervalForResource:", +); +late final _sel_waitsForConnectivity = objc.registerName( + "waitsForConnectivity", +); +late final _sel_setWaitsForConnectivity_ = objc.registerName( + "setWaitsForConnectivity:", +); +late final _sel_isDiscretionary = objc.registerName("isDiscretionary"); +late final _sel_setDiscretionary_ = objc.registerName("setDiscretionary:"); +late final _sel_sharedContainerIdentifier = objc.registerName( + "sharedContainerIdentifier", +); +late final _sel_setSharedContainerIdentifier_ = objc.registerName( + "setSharedContainerIdentifier:", +); +late final _sel_sessionSendsLaunchEvents = objc.registerName( + "sessionSendsLaunchEvents", +); +late final _sel_setSessionSendsLaunchEvents_ = objc.registerName( + "setSessionSendsLaunchEvents:", +); +late final _sel_connectionProxyDictionary = objc.registerName( + "connectionProxyDictionary", +); +late final _sel_setConnectionProxyDictionary_ = objc.registerName( + "setConnectionProxyDictionary:", +); +late final _sel_TLSMinimumSupportedProtocol = objc.registerName( + "TLSMinimumSupportedProtocol", +); +final _objc_msgSend_cbopi9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedInt Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_setTLSMinimumSupportedProtocol_ = objc.registerName( + "setTLSMinimumSupportedProtocol:", +); +final _objc_msgSend_268k8x = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + >(); +late final _sel_TLSMaximumSupportedProtocol = objc.registerName( + "TLSMaximumSupportedProtocol", +); +late final _sel_setTLSMaximumSupportedProtocol_ = objc.registerName( + "setTLSMaximumSupportedProtocol:", +); +late final _sel_TLSMinimumSupportedProtocolVersion = objc.registerName( + "TLSMinimumSupportedProtocolVersion", +); +final _objc_msgSend_9jpwfb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Uint16 Function( + ffi.Pointer, + ffi.Pointer, ) - >.listener( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline, + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingCallable = - ffi.NativeCallable< + >(); +late final _sel_setTLSMinimumSupportedProtocolVersion_ = objc.registerName( + "setTLSMinimumSupportedProtocolVersion:", +); +final _objc_msgSend_1mvuct7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingTrampoline, + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingListenerCallable = - ffi.NativeCallable< + >(); +late final _sel_TLSMaximumSupportedProtocolVersion = objc.registerName( + "TLSMaximumSupportedProtocolVersion", +); +late final _sel_setTLSMaximumSupportedProtocolVersion_ = objc.registerName( + "setTLSMaximumSupportedProtocolVersion:", +); +late final _sel_HTTPShouldSetCookies = objc.registerName( + "HTTPShouldSetCookies", +); +late final _sel_setHTTPShouldSetCookies_ = objc.registerName( + "setHTTPShouldSetCookies:", +); +late final _sel_HTTPCookieAcceptPolicy = objc.registerName( + "HTTPCookieAcceptPolicy", +); +final _objc_msgSend_104dkoq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_setHTTPCookieAcceptPolicy_ = objc.registerName( + "setHTTPCookieAcceptPolicy:", +); +final _objc_msgSend_3q55ys = objc.msgSendPointer + .cast< + ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, ) - >.listener( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingTrampoline, + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, ) - ..keepIsolateAlive = false; + >(); +late final _sel_HTTPAdditionalHeaders = objc.registerName( + "HTTPAdditionalHeaders", +); +late final _sel_setHTTPAdditionalHeaders_ = objc.registerName( + "setHTTPAdditionalHeaders:", +); +late final _sel_HTTPMaximumConnectionsPerHost = objc.registerName( + "HTTPMaximumConnectionsPerHost", +); +late final _sel_setHTTPMaximumConnectionsPerHost_ = objc.registerName( + "setHTTPMaximumConnectionsPerHost:", +); +late final _sel_HTTPCookieStorage = objc.registerName("HTTPCookieStorage"); +late final _sel_setHTTPCookieStorage_ = objc.registerName( + "setHTTPCookieStorage:", +); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - castFromPointer( - ffi.Pointer pointer, { +/// WARNING: NSURLCredentialStorage is a stub. To generate bindings for this class, include +/// NSURLCredentialStorage in your config's objc-interfaces list. +/// +/// NSURLCredentialStorage +extension type NSURLCredentialStorage._(objc.ObjCObject object$) + implements objc.ObjCObject { + /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. + NSURLCredentialStorage.as(objc.ObjCObject other) : object$ = other {} + + /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. + NSURLCredentialStorage.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) => - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - >(pointer, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} +} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - fromFunctionPointer( - ffi.Pointer< +late final _sel_URLCredentialStorage = objc.registerName( + "URLCredentialStorage", +); +late final _sel_setURLCredentialStorage_ = objc.registerName( + "setURLCredentialStorage:", +); +late final _sel_URLCache = objc.registerName("URLCache"); +late final _sel_setURLCache_ = objc.registerName("setURLCache:"); +late final _sel_shouldUseExtendedBackgroundIdleMode = objc.registerName( + "shouldUseExtendedBackgroundIdleMode", +); +late final _sel_setShouldUseExtendedBackgroundIdleMode_ = objc.registerName( + "setShouldUseExtendedBackgroundIdleMode:", +); +late final _sel_protocolClasses = objc.registerName("protocolClasses"); +late final _sel_setProtocolClasses_ = objc.registerName("setProtocolClasses:"); + +/// ! +/// @enum NSURLSessionMultipathServiceType +/// +/// @discussion The NSURLSessionMultipathServiceType enum defines constants that +/// can be used to specify the multipath service type to associate an NSURLSession. The +/// multipath service type determines whether multipath TCP should be attempted and the conditions +/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. +/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). +/// +/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. +/// This is the default value. No entitlement is required to set this value. +/// +/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used +/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the +/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary +/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be +/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. +/// It can be enabled in the Developer section of the Settings app. +enum NSURLSessionMultipathServiceType { + /// None - no multipath (default) + NSURLSessionMultipathServiceTypeNone(0), + + /// Handover - secondary flows brought up when primary flow is not performing adequately. + NSURLSessionMultipathServiceTypeHandover(1), + + /// Interactive - secondary flows created more aggressively. + NSURLSessionMultipathServiceTypeInteractive(2), + + /// Aggregate - multiple subflows used for greater bandwidth. + NSURLSessionMultipathServiceTypeAggregate(3); + + final int value; + const NSURLSessionMultipathServiceType(this.value); + + static NSURLSessionMultipathServiceType fromValue(int value) => + switch (value) { + 0 => NSURLSessionMultipathServiceTypeNone, + 1 => NSURLSessionMultipathServiceTypeHandover, + 2 => NSURLSessionMultipathServiceTypeInteractive, + 3 => NSURLSessionMultipathServiceTypeAggregate, + _ => throw ArgumentError( + 'Unknown value for NSURLSessionMultipathServiceType: $value', + ), + }; +} + +late final _sel_multipathServiceType = objc.registerName( + "multipathServiceType", +); +final _objc_msgSend_1wxwnc0 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_setMultipathServiceType_ = objc.registerName( + "setMultipathServiceType:", +); +final _objc_msgSend_1hx005a = objc.msgSendPointer + .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable, - ptr.cast(), - ), - retain: false, - release: true, - ); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - fromFunction( - void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - >( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable, - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer( - arg0, - retain: true, - release: true, - ), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer( - arg1, - retain: true, - release: true, - ), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer( - arg2, - retain: true, - release: true, - ), - ), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - listener( - void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - >(wrapper, retain: false, release: true); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - blocking( - void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_blockingListenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( - raw, - rawListener, - objc.objCContext, - ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - >(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_CallExtension - on - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > { - void call(objc.NSData? arg0, NSURLResponse? arg1, objc.NSError? arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()( - ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, - arg1?.ref.pointer ?? ffi.nullptr, - arg2?.ref.pointer ?? ffi.nullptr, - ); -} - -late final _sel_dataTaskWithRequest_completionHandler_ = objc.registerName( - "dataTaskWithRequest:completionHandler:", -); -final _objc_msgSend_r0bo0s = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + int, ) >(); -late final _sel_dataTaskWithURL_completionHandler_ = objc.registerName( - "dataTaskWithURL:completionHandler:", +late final _sel_usesClassicLoadingMode = objc.registerName( + "usesClassicLoadingMode", +); +late final _sel_setUsesClassicLoadingMode_ = objc.registerName( + "setUsesClassicLoadingMode:", +); +late final _sel_enablesEarlyData = objc.registerName("enablesEarlyData"); +late final _sel_setEnablesEarlyData_ = objc.registerName( + "setEnablesEarlyData:", +); +late final _sel_backgroundSessionConfiguration_ = objc.registerName( + "backgroundSessionConfiguration:", ); -/// WARNING: NSURLSessionUploadTask is a stub. To generate bindings for this class, include -/// NSURLSessionUploadTask in your config's objc-interfaces list. -/// -/// An NSURLSessionUploadTask does not currently provide any additional -/// functionality over an NSURLSessionDataTask. All delegate messages -/// that may be sent referencing an NSURLSessionDataTask equally apply -/// to NSURLSessionUploadTasks. -class NSURLSessionUploadTask extends NSURLSessionDataTask { - NSURLSessionUploadTask._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +/// NSURLSessionDeprecated +extension NSURLSessionDeprecated on NSURLSessionConfiguration { + /// backgroundSessionConfiguration: + static NSURLSessionConfiguration backgroundSessionConfiguration( + objc.NSString identifier, + ) { objc.checkOsVersionInternal( - 'NSURLSessionUploadTask', + 'NSURLSessionConfiguration.backgroundSessionConfiguration:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSURLSessionConfiguration, + _sel_backgroundSessionConfiguration_, + identifier.ref.pointer, + ); + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: true, + release: true, + ); } - - /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. - NSURLSessionUploadTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionUploadTask] that wraps the given raw object pointer. - NSURLSessionUploadTask.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - -late final _sel_uploadTaskWithRequest_fromFile_completionHandler_ = objc - .registerName("uploadTaskWithRequest:fromFile:completionHandler:"); -final _objc_msgSend_2wiv66 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(); -late final _sel_uploadTaskWithRequest_fromData_completionHandler_ = objc - .registerName("uploadTaskWithRequest:fromData:completionHandler:"); -late final _sel_uploadTaskWithResumeData_completionHandler_ = objc.registerName( - "uploadTaskWithResumeData:completionHandler:", -); -late final _class_NSURLSessionDownloadTask = objc.getClass( - "NSURLSessionDownloadTask", -); -void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSData_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSData_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); +/// Configuration options for an NSURLSession. When a session is +/// created, a copy of the configuration object is made - you cannot +/// modify the configuration of a session after it has been created. +/// +/// The shared session uses the global credential, cache and cookie +/// storage objects. +/// +/// An ephemeral session has no persistent disk storage for cookies, +/// cache or credentials. +/// +/// A background session can be used to perform networking operations +/// on behalf of a suspended application, within certain constraints. +extension type NSURLSessionConfiguration._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject, objc.NSCopying { + /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + NSURLSessionConfiguration.as(objc.ObjCObject other) : object$ = other { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + assert(isA(object$)); } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSData_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSData_blockingTrampoline) - ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, { + /// Constructs a [NSURLSessionConfiguration] that wraps the given raw object pointer. + NSURLSessionConfiguration.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) => objc.ObjCBlock( - pointer, - retain: retain, - release: release, - ); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction arg0)> - > - ptr, - ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_fnPtrCallable, ptr.cast()), - retain: false, - release: true, - ); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + assert(isA(object$)); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock fromFunction( - void Function(objc.NSData?) fn, { - bool keepIsolateAlive = true, - }) => objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_closureCallable, - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: true, release: true), - ), - keepIsolateAlive, - ), - retain: false, - release: true, + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSessionConfiguration, ); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock listener( - void Function(objc.NSData?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - ), - keepIsolateAlive, + /// alloc + static NSURLSessionConfiguration alloc() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionConfiguration, + _sel_alloc, ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, + return NSURLSessionConfiguration.fromPointer( + $ret, retain: false, release: true, ); } - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking( - void Function(objc.NSData?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - ), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_blockingListenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), - ), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - raw, - rawListener, - objc.objCContext, + /// allocWithZone: + static NSURLSessionConfiguration allocWithZone( + ffi.Pointer zone, + ) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLSessionConfiguration, + _sel_allocWithZone_, + zone, ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock( - wrapper, + return NSURLSessionConfiguration.fromPointer( + $ret, retain: false, release: true, ); } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_CallExtension - on objc.ObjCBlock { - void call(objc.NSData? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_cancelByProducingResumeData_ = objc.registerName( - "cancelByProducingResumeData:", -); -final _objc_msgSend_f167m6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(); -/// NSURLSessionDownloadTask is a task that represents a download to -/// local storage. -class NSURLSessionDownloadTask extends NSURLSessionTask { - NSURLSessionDownloadTask._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { + /// backgroundSessionConfigurationWithIdentifier: + static NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier( + objc.NSString identifier, + ) { objc.checkOsVersionInternal( - 'NSURLSessionDownloadTask', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); - } - - /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. - NSURLSessionDownloadTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionDownloadTask] that wraps the given raw object pointer. - NSURLSessionDownloadTask.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLSessionDownloadTask, + final $ret = _objc_msgSend_1sotr3r( + _class_NSURLSessionConfiguration, + _sel_backgroundSessionConfigurationWithIdentifier_, + identifier.ref.pointer, + ); + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: true, + release: true, ); } - /// Cancel the download (and calls the superclass -cancel). If - /// conditions will allow for resuming the download in the future, the - /// callback will be called with an opaque data blob, which may be used - /// with -downloadTaskWithResumeData: to attempt to resume the download. - /// If resume data cannot be created, the completion handler will be - /// called with nil resumeData. - void cancelByProducingResumeData( - objc.ObjCBlock completionHandler, - ) { + /// defaultSessionConfiguration + static NSURLSessionConfiguration getDefaultSessionConfiguration() { objc.checkOsVersionInternal( - 'NSURLSessionDownloadTask.cancelByProducingResumeData:', + 'NSURLSessionConfiguration.defaultSessionConfiguration', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_f167m6( - this.ref.pointer, - _sel_cancelByProducingResumeData_, - completionHandler.ref.pointer, + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionConfiguration, + _sel_defaultSessionConfiguration, + ); + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: true, + release: true, ); } - /// init - NSURLSessionDownloadTask init() { + /// ephemeralSessionConfiguration + static NSURLSessionConfiguration getEphemeralSessionConfiguration() { objc.checkOsVersionInternal( - 'NSURLSessionDownloadTask.init', + 'NSURLSessionConfiguration.ephemeralSessionConfiguration', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionConfiguration, + _sel_ephemeralSessionConfiguration, ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: false, + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: true, release: true, ); } /// new - static NSURLSessionDownloadTask new$() { - objc.checkOsVersionInternal( - 'NSURLSessionDownloadTask.new', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionDownloadTask, + static NSURLSessionConfiguration new$() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionConfiguration, _sel_new, ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, + return NSURLSessionConfiguration.fromPointer( + $ret, retain: false, release: true, ); } - /// Returns a new instance of NSURLSessionDownloadTask constructed with the default `new` method. - factory NSURLSessionDownloadTask() => new$(); -} - -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } + /// Returns a new instance of NSURLSessionConfiguration constructed with the default `new` method. + NSURLSessionConfiguration() : this.as(new$().object$); } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable, - ptr.cast(), - ), - retain: false, - release: true, - ); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - fromFunction( - void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - >( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable, - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSURL.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer( - arg1, - retain: true, - release: true, - ), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer( - arg2, - retain: true, - release: true, - ), - ), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - listener( - void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSURL.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, +extension NSURLSessionConfiguration$Methods on NSURLSessionConfiguration { + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + objc.NSDictionary? get HTTPAdditionalHeaders { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPAdditionalHeaders', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - >(wrapper, retain: false, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_HTTPAdditionalHeaders, + ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - blocking( - void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSURL.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_blockingListenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) => fn( - arg0.address == 0 - ? null - : objc.NSURL.castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), - ), - keepIsolateAlive, + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPCookieAcceptPolicy', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( - raw, - rawListener, - objc.objCContext, + final $ret = _objc_msgSend_104dkoq( + object$.ref.pointer, + _sel_HTTPCookieAcceptPolicy, ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - >(wrapper, retain: false, release: true); + return NSHTTPCookieAcceptPolicy.fromValue($ret); } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_CallExtension - on - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > { - void call(objc.NSURL? arg0, NSURLResponse? arg1, objc.NSError? arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()( - ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, - arg1?.ref.pointer ?? ffi.nullptr, - arg2?.ref.pointer ?? ffi.nullptr, - ); -} - -late final _sel_downloadTaskWithRequest_completionHandler_ = objc.registerName( - "downloadTaskWithRequest:completionHandler:", -); -late final _sel_downloadTaskWithURL_completionHandler_ = objc.registerName( - "downloadTaskWithURL:completionHandler:", -); -late final _sel_downloadTaskWithResumeData_completionHandler_ = objc - .registerName("downloadTaskWithResumeData:completionHandler:"); -/// NSURLSession convenience routines deliver results to -/// a completion handler block. These convenience routines -/// are not available to NSURLSessions that are configured -/// as background sessions. -/// -/// Task objects are always created in a suspended state and -/// must be sent the -resume message before they will execute. -extension NSURLSessionAsynchronousConvenience on NSURLSession { - /// data task convenience methods. These methods create tasks that - /// bypass the normal delegate calls for response and data delivery, - /// and provide a simple cancelable asynchronous interface to receiving - /// data. Errors will be returned in the NSURLErrorDomain, - /// see . The delegate, if any, will still be - /// called for authentication challenges. - NSURLSessionDataTask dataTaskWithRequest( - NSURLRequest request, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + NSHTTPCookieStorage? get HTTPCookieStorage { objc.checkOsVersionInternal( - 'NSURLSession.dataTaskWithRequest:completionHandler:', + 'NSURLSessionConfiguration.HTTPCookieStorage', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_dataTaskWithRequest_completionHandler_, - request.ref.pointer, - completionHandler.ref.pointer, - ); - return NSURLSessionDataTask.castFromPointer( - _ret, - retain: true, - release: true, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_HTTPCookieStorage, ); + return $ret.address == 0 + ? null + : NSHTTPCookieStorage.fromPointer($ret, retain: true, release: true); } - /// dataTaskWithURL:completionHandler: - NSURLSessionDataTask dataTaskWithURL( - objc.NSURL url, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The maximum number of simultaneous persistent connections per host + DartNSInteger get HTTPMaximumConnectionsPerHost { objc.checkOsVersionInternal( - 'NSURLSession.dataTaskWithURL:completionHandler:', + 'NSURLSessionConfiguration.HTTPMaximumConnectionsPerHost', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_dataTaskWithURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer, - ); - return NSURLSessionDataTask.castFromPointer( - _ret, - retain: true, - release: true, + return _objc_msgSend_1hz7y9r( + object$.ref.pointer, + _sel_HTTPMaximumConnectionsPerHost, ); } - /// upload convenience method. - NSURLSessionUploadTask uploadTaskWithRequest( - NSURLRequest request, { - required objc.NSURL fromFile, - required objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// Allow the session to set cookies on requests + bool get HTTPShouldSetCookies { objc.checkOsVersionInternal( - 'NSURLSession.uploadTaskWithRequest:fromFile:completionHandler:', + 'NSURLSessionConfiguration.HTTPShouldSetCookies', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_2wiv66( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromFile_completionHandler_, - request.ref.pointer, - fromFile.ref.pointer, - completionHandler.ref.pointer, + return _objc_msgSend_91o635(object$.ref.pointer, _sel_HTTPShouldSetCookies); + } + + /// Allow the use of HTTP pipelining + bool get HTTPShouldUsePipelining { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.HTTPShouldUsePipelining', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - return NSURLSessionUploadTask.castFromPointer( - _ret, - retain: true, - release: true, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_HTTPShouldUsePipelining, ); } - /// uploadTaskWithRequest:fromData:completionHandler: - NSURLSessionUploadTask uploadTaskWithRequest$1( - NSURLRequest request, { - objc.NSData? fromData, - required objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The maximum allowable versions of the TLS protocol, from + SSLProtocol get TLSMaximumSupportedProtocol { objc.checkOsVersionInternal( - 'NSURLSession.uploadTaskWithRequest:fromData:completionHandler:', + 'NSURLSessionConfiguration.TLSMaximumSupportedProtocol', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_2wiv66( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromData_completionHandler_, - request.ref.pointer, - fromData?.ref.pointer ?? ffi.nullptr, - completionHandler.ref.pointer, - ); - return NSURLSessionUploadTask.castFromPointer( - _ret, - retain: true, - release: true, + final $ret = _objc_msgSend_cbopi9( + object$.ref.pointer, + _sel_TLSMaximumSupportedProtocol, ); + return SSLProtocol.fromValue($ret); } - /// Creates a URLSessionUploadTask from a resume data blob. If resuming from an upload - /// file, the file must still exist and be unmodified. - /// - /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. - /// - Parameter completionHandler: The completion handler to call when the load request is complete. - /// - Returns: A new session upload task, or nil if the resumeData is invalid. - NSURLSessionUploadTask uploadTaskWithResumeData( - objc.NSData resumeData, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The maximum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { objc.checkOsVersionInternal( - 'NSURLSession.uploadTaskWithResumeData:completionHandler:', - iOS: (false, (17, 0, 0)), - macOS: (false, (14, 0, 0)), - ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_uploadTaskWithResumeData_completionHandler_, - resumeData.ref.pointer, - completionHandler.ref.pointer, + 'NSURLSessionConfiguration.TLSMaximumSupportedProtocolVersion', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - return NSURLSessionUploadTask.castFromPointer( - _ret, - retain: true, - release: true, + final $ret = _objc_msgSend_9jpwfb( + object$.ref.pointer, + _sel_TLSMaximumSupportedProtocolVersion, ); + return tls_protocol_version_t.fromValue($ret); } - /// download task convenience methods. When a download successfully - /// completes, the NSURL will point to a file that must be read or - /// copied during the invocation of the completion routine. The file - /// will be removed automatically. - NSURLSessionDownloadTask downloadTaskWithRequest( - NSURLRequest request, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The minimum allowable versions of the TLS protocol, from + SSLProtocol get TLSMinimumSupportedProtocol { objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithRequest:completionHandler:', + 'NSURLSessionConfiguration.TLSMinimumSupportedProtocol', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_downloadTaskWithRequest_completionHandler_, - request.ref.pointer, - completionHandler.ref.pointer, + final $ret = _objc_msgSend_cbopi9( + object$.ref.pointer, + _sel_TLSMinimumSupportedProtocol, ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, + return SSLProtocol.fromValue($ret); + } + + /// The minimum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.TLSMinimumSupportedProtocolVersion', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); + final $ret = _objc_msgSend_9jpwfb( + object$.ref.pointer, + _sel_TLSMinimumSupportedProtocolVersion, + ); + return tls_protocol_version_t.fromValue($ret); } - /// downloadTaskWithURL:completionHandler: - NSURLSessionDownloadTask downloadTaskWithURL( - objc.NSURL url, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The URL resource cache, or nil to indicate that no caching is to be performed + NSURLCache? get URLCache { objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithURL:completionHandler:', + 'NSURLSessionConfiguration.URLCache', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_downloadTaskWithURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer, - ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, - ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_URLCache); + return $ret.address == 0 + ? null + : NSURLCache.fromPointer($ret, retain: true, release: true); } - /// downloadTaskWithResumeData:completionHandler: - NSURLSessionDownloadTask downloadTaskWithResumeData( - objc.NSData resumeData, { - required objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) - > - completionHandler, - }) { + /// The credential storage object, or nil to indicate that no credential storage is to be used + NSURLCredentialStorage? get URLCredentialStorage { objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithResumeData:completionHandler:', + 'NSURLSessionConfiguration.URLCredentialStorage', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_downloadTaskWithResumeData_completionHandler_, - resumeData.ref.pointer, - completionHandler.ref.pointer, - ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_URLCredentialStorage, ); + return $ret.address == 0 + ? null + : NSURLCredentialStorage.fromPointer($ret, retain: true, release: true); } -} - -late final _sel_sharedSession = objc.registerName("sharedSession"); -late final _class_NSURLSessionConfiguration = objc.getClass( - "NSURLSessionConfiguration", -); -late final _sel_backgroundSessionConfiguration_ = objc.registerName( - "backgroundSessionConfiguration:", -); -/// NSURLSessionDeprecated -extension NSURLSessionDeprecated on NSURLSessionConfiguration { - /// backgroundSessionConfiguration: - static NSURLSessionConfiguration backgroundSessionConfiguration( - objc.NSString identifier, - ) { + /// allow request to route over cellular. + bool get allowsCellularAccess { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.backgroundSessionConfiguration:', + 'NSURLSessionConfiguration.allowsCellularAccess', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSURLSessionConfiguration, - _sel_backgroundSessionConfiguration_, - identifier.ref.pointer, + return _objc_msgSend_91o635(object$.ref.pointer, _sel_allowsCellularAccess); + } + + /// allow request to route over networks in constrained mode. Defaults to YES. + bool get allowsConstrainedNetworkAccess { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.allowsConstrainedNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_allowsConstrainedNetworkAccess, ); } -} -late final _sel_defaultSessionConfiguration = objc.registerName( - "defaultSessionConfiguration", -); -late final _sel_ephemeralSessionConfiguration = objc.registerName( - "ephemeralSessionConfiguration", -); -late final _sel_backgroundSessionConfigurationWithIdentifier_ = objc - .registerName("backgroundSessionConfigurationWithIdentifier:"); -late final _sel_identifier = objc.registerName("identifier"); -late final _sel_requestCachePolicy = objc.registerName("requestCachePolicy"); -late final _sel_setRequestCachePolicy_ = objc.registerName( - "setRequestCachePolicy:", -); -late final _sel_timeoutIntervalForRequest = objc.registerName( - "timeoutIntervalForRequest", -); -late final _sel_setTimeoutIntervalForRequest_ = objc.registerName( - "setTimeoutIntervalForRequest:", -); -late final _sel_timeoutIntervalForResource = objc.registerName( - "timeoutIntervalForResource", -); -late final _sel_setTimeoutIntervalForResource_ = objc.registerName( - "setTimeoutIntervalForResource:", -); -late final _sel_waitsForConnectivity = objc.registerName( - "waitsForConnectivity", -); -late final _sel_setWaitsForConnectivity_ = objc.registerName( - "setWaitsForConnectivity:", -); -late final _sel_isDiscretionary = objc.registerName("isDiscretionary"); -late final _sel_setDiscretionary_ = objc.registerName("setDiscretionary:"); -late final _sel_sharedContainerIdentifier = objc.registerName( - "sharedContainerIdentifier", -); -late final _sel_setSharedContainerIdentifier_ = objc.registerName( - "setSharedContainerIdentifier:", -); -late final _sel_sessionSendsLaunchEvents = objc.registerName( - "sessionSendsLaunchEvents", -); -late final _sel_setSessionSendsLaunchEvents_ = objc.registerName( - "setSessionSendsLaunchEvents:", -); -late final _sel_connectionProxyDictionary = objc.registerName( - "connectionProxyDictionary", -); -late final _sel_setConnectionProxyDictionary_ = objc.registerName( - "setConnectionProxyDictionary:", -); -late final _sel_TLSMinimumSupportedProtocol = objc.registerName( - "TLSMinimumSupportedProtocol", -); -final _objc_msgSend_cbopi9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setTLSMinimumSupportedProtocol_ = objc.registerName( - "setTLSMinimumSupportedProtocol:", -); -final _objc_msgSend_268k8x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ) - >(); -late final _sel_TLSMaximumSupportedProtocol = objc.registerName( - "TLSMaximumSupportedProtocol", -); -late final _sel_setTLSMaximumSupportedProtocol_ = objc.registerName( - "setTLSMaximumSupportedProtocol:", -); -late final _sel_TLSMinimumSupportedProtocolVersion = objc.registerName( - "TLSMinimumSupportedProtocolVersion", -); -final _objc_msgSend_9jpwfb = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Uint16 Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setTLSMinimumSupportedProtocolVersion_ = objc.registerName( - "setTLSMinimumSupportedProtocolVersion:", -); -final _objc_msgSend_1mvuct7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ) - >(); -late final _sel_TLSMaximumSupportedProtocolVersion = objc.registerName( - "TLSMaximumSupportedProtocolVersion", -); -late final _sel_setTLSMaximumSupportedProtocolVersion_ = objc.registerName( - "setTLSMaximumSupportedProtocolVersion:", -); -late final _sel_HTTPShouldSetCookies = objc.registerName( - "HTTPShouldSetCookies", -); -late final _sel_setHTTPShouldSetCookies_ = objc.registerName( - "setHTTPShouldSetCookies:", -); -late final _sel_HTTPCookieAcceptPolicy = objc.registerName( - "HTTPCookieAcceptPolicy", -); -final _objc_msgSend_104dkoq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setHTTPCookieAcceptPolicy_ = objc.registerName( - "setHTTPCookieAcceptPolicy:", -); -final _objc_msgSend_3q55ys = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ) - >(); -late final _sel_HTTPAdditionalHeaders = objc.registerName( - "HTTPAdditionalHeaders", -); -late final _sel_setHTTPAdditionalHeaders_ = objc.registerName( - "setHTTPAdditionalHeaders:", -); -late final _sel_HTTPMaximumConnectionsPerHost = objc.registerName( - "HTTPMaximumConnectionsPerHost", -); -late final _sel_setHTTPMaximumConnectionsPerHost_ = objc.registerName( - "setHTTPMaximumConnectionsPerHost:", -); -late final _sel_HTTPCookieStorage = objc.registerName("HTTPCookieStorage"); -late final _sel_setHTTPCookieStorage_ = objc.registerName( - "setHTTPCookieStorage:", -); - -/// WARNING: NSURLCredentialStorage is a stub. To generate bindings for this class, include -/// NSURLCredentialStorage in your config's objc-interfaces list. -/// -/// NSURLCredentialStorage -class NSURLCredentialStorage extends objc.ObjCObjectBase { - NSURLCredentialStorage._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - - /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. - NSURLCredentialStorage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. - NSURLCredentialStorage.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - -late final _sel_URLCredentialStorage = objc.registerName( - "URLCredentialStorage", -); -late final _sel_setURLCredentialStorage_ = objc.registerName( - "setURLCredentialStorage:", -); -late final _sel_URLCache = objc.registerName("URLCache"); -late final _sel_setURLCache_ = objc.registerName("setURLCache:"); -late final _sel_shouldUseExtendedBackgroundIdleMode = objc.registerName( - "shouldUseExtendedBackgroundIdleMode", -); -late final _sel_setShouldUseExtendedBackgroundIdleMode_ = objc.registerName( - "setShouldUseExtendedBackgroundIdleMode:", -); -late final _sel_protocolClasses = objc.registerName("protocolClasses"); -late final _sel_setProtocolClasses_ = objc.registerName("setProtocolClasses:"); - -/// ! -/// @enum NSURLSessionMultipathServiceType -/// -/// @discussion The NSURLSessionMultipathServiceType enum defines constants that -/// can be used to specify the multipath service type to associate an NSURLSession. The -/// multipath service type determines whether multipath TCP should be attempted and the conditions -/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. -/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). -/// -/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. -/// This is the default value. No entitlement is required to set this value. -/// -/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used -/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the -/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary -/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be -/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. -/// It can be enabled in the Developer section of the Settings app. -enum NSURLSessionMultipathServiceType { - /// None - no multipath (default) - NSURLSessionMultipathServiceTypeNone(0), - - /// Handover - secondary flows brought up when primary flow is not performing adequately. - NSURLSessionMultipathServiceTypeHandover(1), - - /// Interactive - secondary flows created more aggressively. - NSURLSessionMultipathServiceTypeInteractive(2), - - /// Aggregate - multiple subflows used for greater bandwidth. - NSURLSessionMultipathServiceTypeAggregate(3); - - final int value; - const NSURLSessionMultipathServiceType(this.value); - - static NSURLSessionMultipathServiceType fromValue(int value) => - switch (value) { - 0 => NSURLSessionMultipathServiceTypeNone, - 1 => NSURLSessionMultipathServiceTypeHandover, - 2 => NSURLSessionMultipathServiceTypeInteractive, - 3 => NSURLSessionMultipathServiceTypeAggregate, - _ => throw ArgumentError( - 'Unknown value for NSURLSessionMultipathServiceType: $value', - ), - }; -} - -late final _sel_multipathServiceType = objc.registerName( - "multipathServiceType", -); -final _objc_msgSend_1wxwnc0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setMultipathServiceType_ = objc.registerName( - "setMultipathServiceType:", -); -final _objc_msgSend_1hx005a = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ) - >(); -late final _sel_usesClassicLoadingMode = objc.registerName( - "usesClassicLoadingMode", -); -late final _sel_setUsesClassicLoadingMode_ = objc.registerName( - "setUsesClassicLoadingMode:", -); - -/// Configuration options for an NSURLSession. When a session is -/// created, a copy of the configuration object is made - you cannot -/// modify the configuration of a session after it has been created. -/// -/// The shared session uses the global credential, cache and cookie -/// storage objects. -/// -/// An ephemeral session has no persistent disk storage for cookies, -/// cache or credentials. -/// -/// A background session can be used to perform networking operations -/// on behalf of a suspended application, within certain constraints. -class NSURLSessionConfiguration extends objc.NSObject - implements objc.NSCopying { - NSURLSessionConfiguration._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - } - - /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. - NSURLSessionConfiguration.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionConfiguration] that wraps the given raw object pointer. - NSURLSessionConfiguration.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLSessionConfiguration, - ); - } - - /// defaultSessionConfiguration - static NSURLSessionConfiguration getDefaultSessionConfiguration() { + /// allow request to route over expensive networks. Defaults to YES. + bool get allowsExpensiveNetworkAccess { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.defaultSessionConfiguration', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionConfiguration, - _sel_defaultSessionConfiguration, + 'NSURLSessionConfiguration.allowsExpensiveNetworkAccess', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_allowsExpensiveNetworkAccess, ); } - /// ephemeralSessionConfiguration - static NSURLSessionConfiguration getEphemeralSessionConfiguration() { + /// The proxy dictionary, as described by + objc.NSDictionary? get connectionProxyDictionary { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.ephemeralSessionConfiguration', + 'NSURLSessionConfiguration.connectionProxyDictionary', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionConfiguration, - _sel_ephemeralSessionConfiguration, - ); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_connectionProxyDictionary, ); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// backgroundSessionConfigurationWithIdentifier: - static NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier( - objc.NSString identifier, - ) { + /// Enables HTTP/3 0-RTT early data transmission of safe requests (GET or HEAD + /// requests). + /// + /// WARNING: Inclusion in TLS early data changes the security guarantees offered + /// by TLS. + /// + /// Requests sent in early data are not covered by anti-replay security + /// protections. Early data must be idempotent and the impact of adversarial + /// replays must be carefully evaluated, as the data may be replayed. Early data + /// also does not provide full forward secrecy; data transmitted is more + /// susceptible to data breach and security compromise of the server, even if + /// the breach happens after the data was transmitted. + /// + /// See Section 8 of RFC8446 for more details. + /// + /// https://datatracker.ietf.org/doc/html/rfc8446#section-8 + /// + /// See RFC8470 for additional discussion and security considerations. + /// + /// https://datatracker.ietf.org/doc/html/rfc8470 + /// + /// If these risks are acceptable for your use case, set this property to YES. + /// If unsure, NO is the safest option. + /// + /// NOTE: Not supported in the classic loading mode. + /// + /// Defaults to NO. + bool get enablesEarlyData { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSURLSessionConfiguration, - _sel_backgroundSessionConfigurationWithIdentifier_, - identifier.ref.pointer, - ); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, + 'NSURLSessionConfiguration.enablesEarlyData', + iOS: (false, (26, 0, 0)), + macOS: (false, (26, 0, 0)), ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_enablesEarlyData); } /// identifier for the background session configuration @@ -66185,140 +64447,133 @@ class NSURLSessionConfiguration extends objc.NSObject iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_identifier); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_identifier); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// default cache policy for requests - NSURLRequestCachePolicy get requestCachePolicy { + /// init + NSURLSessionConfiguration init() { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.requestCachePolicy', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_8jm3uo( - this.ref.pointer, - _sel_requestCachePolicy, + 'NSURLSessionConfiguration.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), ); - return NSURLRequestCachePolicy.fromValue(_ret); - } - - /// default cache policy for requests - set requestCachePolicy(NSURLRequestCachePolicy value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setRequestCachePolicy:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); - _objc_msgSend_1yjxuv2( - this.ref.pointer, - _sel_setRequestCachePolicy_, - value.value, + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: false, + release: true, ); } - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - DartNSTimeInterval get timeoutIntervalForRequest { + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + bool get isDiscretionary { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.timeoutIntervalForRequest', + 'NSURLSessionConfiguration.isDiscretionary', iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + macOS: (false, (10, 10, 0)), ); - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, - _sel_timeoutIntervalForRequest, - ) - : _objc_msgSend_1ukqyt8( - this.ref.pointer, - _sel_timeoutIntervalForRequest, - ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_isDiscretionary); } - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - set timeoutIntervalForRequest(DartNSTimeInterval value) { + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + NSURLSessionMultipathServiceType get multipathServiceType { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setTimeoutIntervalForRequest:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.multipathServiceType', + iOS: (false, (11, 0, 0)), + macOS: (true, null), ); - _objc_msgSend_hwm8nu( - this.ref.pointer, - _sel_setTimeoutIntervalForRequest_, - value, + final $ret = _objc_msgSend_1wxwnc0( + object$.ref.pointer, + _sel_multipathServiceType, ); + return NSURLSessionMultipathServiceType.fromValue($ret); } - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - DartNSTimeInterval get timeoutIntervalForResource { + /// type of service for requests. + NSURLRequestNetworkServiceType get networkServiceType { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.timeoutIntervalForResource', + 'NSURLSessionConfiguration.networkServiceType', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, - _sel_timeoutIntervalForResource, - ) - : _objc_msgSend_1ukqyt8( - this.ref.pointer, - _sel_timeoutIntervalForResource, - ); + final $ret = _objc_msgSend_t4uaw1( + object$.ref.pointer, + _sel_networkServiceType, + ); + return NSURLRequestNetworkServiceType.fromValue($ret); } - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - set timeoutIntervalForResource(DartNSTimeInterval value) { + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + objc.NSArray? get protocolClasses { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setTimeoutIntervalForResource:', + 'NSURLSessionConfiguration.protocolClasses', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_hwm8nu( - this.ref.pointer, - _sel_setTimeoutIntervalForResource_, - value, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_protocolClasses, ); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// type of service for requests. - NSURLRequestNetworkServiceType get networkServiceType { + /// default cache policy for requests + NSURLRequestCachePolicy get requestCachePolicy { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.networkServiceType', + 'NSURLSessionConfiguration.requestCachePolicy', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_t4uaw1( - this.ref.pointer, - _sel_networkServiceType, + final $ret = _objc_msgSend_8jm3uo( + object$.ref.pointer, + _sel_requestCachePolicy, ); - return NSURLRequestNetworkServiceType.fromValue(_ret); + return NSURLRequestCachePolicy.fromValue($ret); } - /// type of service for requests. - set networkServiceType(NSURLRequestNetworkServiceType value) { + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + bool get requiresDNSSECValidation { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setNetworkServiceType:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.requiresDNSSECValidation', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0)), ); - _objc_msgSend_1mse4s1( - this.ref.pointer, - _sel_setNetworkServiceType_, - value.value, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_requiresDNSSECValidation, ); } - /// allow request to route over cellular. - bool get allowsCellularAccess { + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + bool get sessionSendsLaunchEvents { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.allowsCellularAccess', + 'NSURLSessionConfiguration.sessionSendsLaunchEvents', iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + macOS: (false, (11, 0, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_sessionSendsLaunchEvents, ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } /// allow request to route over cellular. @@ -66329,22 +64584,23 @@ class NSURLSessionConfiguration extends objc.NSObject macOS: (false, (10, 9, 0)), ); _objc_msgSend_1s56lr9( - this.ref.pointer, + object$.ref.pointer, _sel_setAllowsCellularAccess_, value, ); } - /// allow request to route over expensive networks. Defaults to YES. - bool get allowsExpensiveNetworkAccess { + /// allow request to route over networks in constrained mode. Defaults to YES. + set allowsConstrainedNetworkAccess(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.allowsExpensiveNetworkAccess', + 'NSURLSessionConfiguration.setAllowsConstrainedNetworkAccess:', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_allowsExpensiveNetworkAccess, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setAllowsConstrainedNetworkAccess_, + value, ); } @@ -66356,327 +64612,298 @@ class NSURLSessionConfiguration extends objc.NSObject macOS: (false, (10, 15, 0)), ); _objc_msgSend_1s56lr9( - this.ref.pointer, + object$.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value, ); } - /// allow request to route over networks in constrained mode. Defaults to YES. - bool get allowsConstrainedNetworkAccess { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.allowsConstrainedNetworkAccess', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_allowsConstrainedNetworkAccess, - ); - } - - /// allow request to route over networks in constrained mode. Defaults to YES. - set allowsConstrainedNetworkAccess(bool value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setAllowsConstrainedNetworkAccess:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setAllowsConstrainedNetworkAccess_, - value, - ); - } - - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - bool get requiresDNSSECValidation { + /// The proxy dictionary, as described by + set connectionProxyDictionary(objc.NSDictionary? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.requiresDNSSECValidation', - iOS: (false, (16, 0, 0)), - macOS: (false, (13, 0, 0)), + 'NSURLSessionConfiguration.setConnectionProxyDictionary:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_requiresDNSSECValidation, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setConnectionProxyDictionary_, + value?.ref.pointer ?? ffi.nullptr, ); } - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - set requiresDNSSECValidation(bool value) { + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + set isDiscretionary(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setRequiresDNSSECValidation:', - iOS: (false, (16, 0, 0)), - macOS: (false, (13, 0, 0)), - ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setRequiresDNSSECValidation_, - value, + 'NSURLSessionConfiguration.setDiscretionary:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 10, 0)), ); + _objc_msgSend_1s56lr9(object$.ref.pointer, _sel_setDiscretionary_, value); } - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. + /// Enables HTTP/3 0-RTT early data transmission of safe requests (GET or HEAD + /// requests). /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). + /// WARNING: Inclusion in TLS early data changes the security guarantees offered + /// by TLS. /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - bool get waitsForConnectivity { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.waitsForConnectivity', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_waitsForConnectivity); - } - - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. + /// Requests sent in early data are not covered by anti-replay security + /// protections. Early data must be idempotent and the impact of adversarial + /// replays must be carefully evaluated, as the data may be replayed. Early data + /// also does not provide full forward secrecy; data transmitted is more + /// susceptible to data breach and security compromise of the server, even if + /// the breach happens after the data was transmitted. /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). + /// See Section 8 of RFC8446 for more details. /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - set waitsForConnectivity(bool value) { + /// https://datatracker.ietf.org/doc/html/rfc8446#section-8 + /// + /// See RFC8470 for additional discussion and security considerations. + /// + /// https://datatracker.ietf.org/doc/html/rfc8470 + /// + /// If these risks are acceptable for your use case, set this property to YES. + /// If unsure, NO is the safest option. + /// + /// NOTE: Not supported in the classic loading mode. + /// + /// Defaults to NO. + set enablesEarlyData(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setWaitsForConnectivity:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), + 'NSURLSessionConfiguration.setEnablesEarlyData:', + iOS: (false, (26, 0, 0)), + macOS: (false, (26, 0, 0)), ); _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setWaitsForConnectivity_, + object$.ref.pointer, + _sel_setEnablesEarlyData_, value, ); } - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - bool get discretionary { + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + set HTTPAdditionalHeaders(objc.NSDictionary? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.isDiscretionary', + 'NSURLSessionConfiguration.setHTTPAdditionalHeaders:', iOS: (false, (7, 0, 0)), - macOS: (false, (10, 10, 0)), + macOS: (false, (10, 9, 0)), ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_isDiscretionary); - } - - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - set discretionary(bool value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setDiscretionary:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 10, 0)), + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setHTTPAdditionalHeaders_, + value?.ref.pointer ?? ffi.nullptr, ); - _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setDiscretionary_, value); } - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - objc.NSString? get sharedContainerIdentifier { + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.sharedContainerIdentifier', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + 'NSURLSessionConfiguration.setHTTPCookieAcceptPolicy:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_sharedContainerIdentifier, + _objc_msgSend_3q55ys( + object$.ref.pointer, + _sel_setHTTPCookieAcceptPolicy_, + value.value, ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - set sharedContainerIdentifier(objc.NSString? value) { + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + set HTTPCookieStorage(NSHTTPCookieStorage? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setSharedContainerIdentifier:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + 'NSURLSessionConfiguration.setHTTPCookieStorage:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setSharedContainerIdentifier_, + object$.ref.pointer, + _sel_setHTTPCookieStorage_, value?.ref.pointer ?? ffi.nullptr, ); } - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - bool get sessionSendsLaunchEvents { + /// The maximum number of simultaneous persistent connections per host + set HTTPMaximumConnectionsPerHost(DartNSInteger value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.sessionSendsLaunchEvents', + 'NSURLSessionConfiguration.setHTTPMaximumConnectionsPerHost:', iOS: (false, (7, 0, 0)), - macOS: (false, (11, 0, 0)), + macOS: (false, (10, 9, 0)), ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_sessionSendsLaunchEvents, + _objc_msgSend_4sp4xj( + object$.ref.pointer, + _sel_setHTTPMaximumConnectionsPerHost_, + value, ); } - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - set sessionSendsLaunchEvents(bool value) { + /// Allow the session to set cookies on requests + set HTTPShouldSetCookies(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setSessionSendsLaunchEvents:', + 'NSURLSessionConfiguration.setHTTPShouldSetCookies:', iOS: (false, (7, 0, 0)), - macOS: (false, (11, 0, 0)), + macOS: (false, (10, 9, 0)), ); _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setSessionSendsLaunchEvents_, + object$.ref.pointer, + _sel_setHTTPShouldSetCookies_, value, ); } - /// The proxy dictionary, as described by - objc.NSDictionary? get connectionProxyDictionary { + /// Allow the use of HTTP pipelining + set HTTPShouldUsePipelining(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.connectionProxyDictionary', + 'NSURLSessionConfiguration.setHTTPShouldUsePipelining:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_connectionProxyDictionary, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setHTTPShouldUsePipelining_, + value, ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// The proxy dictionary, as described by - set connectionProxyDictionary(objc.NSDictionary? value) { + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + set multipathServiceType(NSURLSessionMultipathServiceType value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setConnectionProxyDictionary:', + 'NSURLSessionConfiguration.setMultipathServiceType:', + iOS: (false, (11, 0, 0)), + macOS: (true, null), + ); + _objc_msgSend_1hx005a( + object$.ref.pointer, + _sel_setMultipathServiceType_, + value.value, + ); + } + + /// type of service for requests. + set networkServiceType(NSURLRequestNetworkServiceType value) { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.setNetworkServiceType:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setConnectionProxyDictionary_, - value?.ref.pointer ?? ffi.nullptr, + _objc_msgSend_1mse4s1( + object$.ref.pointer, + _sel_setNetworkServiceType_, + value.value, ); } - /// The minimum allowable versions of the TLS protocol, from - SSLProtocol get TLSMinimumSupportedProtocol { + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + set protocolClasses(objc.NSArray? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.TLSMinimumSupportedProtocol', + 'NSURLSessionConfiguration.setProtocolClasses:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_cbopi9( - this.ref.pointer, - _sel_TLSMinimumSupportedProtocol, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setProtocolClasses_, + value?.ref.pointer ?? ffi.nullptr, ); - return SSLProtocol.fromValue(_ret); } - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocol(SSLProtocol value) { + /// default cache policy for requests + set requestCachePolicy(NSURLRequestCachePolicy value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocol:', + 'NSURLSessionConfiguration.setRequestCachePolicy:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_268k8x( - this.ref.pointer, - _sel_setTLSMinimumSupportedProtocol_, + _objc_msgSend_1yjxuv2( + object$.ref.pointer, + _sel_setRequestCachePolicy_, value.value, ); } - /// The maximum allowable versions of the TLS protocol, from - SSLProtocol get TLSMaximumSupportedProtocol { + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + set requiresDNSSECValidation(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.TLSMaximumSupportedProtocol', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.setRequiresDNSSECValidation:', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0)), ); - final _ret = _objc_msgSend_cbopi9( - this.ref.pointer, - _sel_TLSMaximumSupportedProtocol, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setRequiresDNSSECValidation_, + value, ); - return SSLProtocol.fromValue(_ret); } - /// The maximum allowable versions of the TLS protocol, from - set TLSMaximumSupportedProtocol(SSLProtocol value) { + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + set sessionSendsLaunchEvents(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setTLSMaximumSupportedProtocol:', + 'NSURLSessionConfiguration.setSessionSendsLaunchEvents:', iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + macOS: (false, (11, 0, 0)), ); - _objc_msgSend_268k8x( - this.ref.pointer, - _sel_setTLSMaximumSupportedProtocol_, - value.value, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setSessionSendsLaunchEvents_, + value, ); } - /// The minimum allowable versions of the TLS protocol, from - tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + set sharedContainerIdentifier(objc.NSString? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.TLSMinimumSupportedProtocolVersion', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSessionConfiguration.setSharedContainerIdentifier:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); - final _ret = _objc_msgSend_9jpwfb( - this.ref.pointer, - _sel_TLSMinimumSupportedProtocolVersion, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setSharedContainerIdentifier_, + value?.ref.pointer ?? ffi.nullptr, ); - return tls_protocol_version_t.fromValue(_ret); } - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { + /// setShouldUseExtendedBackgroundIdleMode: + set shouldUseExtendedBackgroundIdleMode(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocolVersion:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSessionConfiguration.setShouldUseExtendedBackgroundIdleMode:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); - _objc_msgSend_1mvuct7( - this.ref.pointer, - _sel_setTLSMinimumSupportedProtocolVersion_, - value.value, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setShouldUseExtendedBackgroundIdleMode_, + value, ); } - /// The maximum allowable versions of the TLS protocol, from - tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { + /// The maximum allowable versions of the TLS protocol, from + set TLSMaximumSupportedProtocol(SSLProtocol value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.TLSMaximumSupportedProtocolVersion', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSessionConfiguration.setTLSMaximumSupportedProtocol:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_9jpwfb( - this.ref.pointer, - _sel_TLSMaximumSupportedProtocolVersion, + _objc_msgSend_268k8x( + object$.ref.pointer, + _sel_setTLSMaximumSupportedProtocol_, + value.value, ); - return tls_protocol_version_t.fromValue(_ret); } /// The maximum allowable versions of the TLS protocol, from @@ -66687,1136 +64914,2388 @@ class NSURLSessionConfiguration extends objc.NSObject macOS: (false, (10, 15, 0)), ); _objc_msgSend_1mvuct7( - this.ref.pointer, + object$.ref.pointer, _sel_setTLSMaximumSupportedProtocolVersion_, value.value, ); } - /// Allow the use of HTTP pipelining - bool get HTTPShouldUsePipelining { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPShouldUsePipelining', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } - - /// Allow the use of HTTP pipelining - set HTTPShouldUsePipelining(bool value) { + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocol(SSLProtocol value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPShouldUsePipelining:', + 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocol:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setHTTPShouldUsePipelining_, - value, - ); - } - - /// Allow the session to set cookies on requests - bool get HTTPShouldSetCookies { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPShouldSetCookies', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + _objc_msgSend_268k8x( + object$.ref.pointer, + _sel_setTLSMinimumSupportedProtocol_, + value.value, ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldSetCookies); } - /// Allow the session to set cookies on requests - set HTTPShouldSetCookies(bool value) { + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPShouldSetCookies:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.setTLSMinimumSupportedProtocolVersion:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setHTTPShouldSetCookies_, - value, + _objc_msgSend_1mvuct7( + object$.ref.pointer, + _sel_setTLSMinimumSupportedProtocolVersion_, + value.value, ); } - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + set timeoutIntervalForRequest(DartNSTimeInterval value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPCookieAcceptPolicy', + 'NSURLSessionConfiguration.setTimeoutIntervalForRequest:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_104dkoq( - this.ref.pointer, - _sel_HTTPCookieAcceptPolicy, + _objc_msgSend_hwm8nu( + object$.ref.pointer, + _sel_setTimeoutIntervalForRequest_, + value, ); - return NSHTTPCookieAcceptPolicy.fromValue(_ret); } - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + set timeoutIntervalForResource(DartNSTimeInterval value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPCookieAcceptPolicy:', + 'NSURLSessionConfiguration.setTimeoutIntervalForResource:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_3q55ys( - this.ref.pointer, - _sel_setHTTPCookieAcceptPolicy_, - value.value, + _objc_msgSend_hwm8nu( + object$.ref.pointer, + _sel_setTimeoutIntervalForResource_, + value, ); } - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - objc.NSDictionary? get HTTPAdditionalHeaders { + /// The URL resource cache, or nil to indicate that no caching is to be performed + set URLCache(NSURLCache? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPAdditionalHeaders', + 'NSURLSessionConfiguration.setURLCache:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_HTTPAdditionalHeaders, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setURLCache_, + value?.ref.pointer ?? ffi.nullptr, ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - set HTTPAdditionalHeaders(objc.NSDictionary? value) { + /// The credential storage object, or nil to indicate that no credential storage is to be used + set URLCredentialStorage(NSURLCredentialStorage? value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPAdditionalHeaders:', + 'NSURLSessionConfiguration.setURLCredentialStorage:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setHTTPAdditionalHeaders_, + object$.ref.pointer, + _sel_setURLCredentialStorage_, value?.ref.pointer ?? ffi.nullptr, ); } - /// The maximum number of simultaneous persistent connections per host - DartNSInteger get HTTPMaximumConnectionsPerHost { + /// Uses the classic network loader. + /// + /// NOTE: FTP and HTTP/1 pipelining are only supported in the classic loading mode. + /// + /// Defaults to YES. The default may be NO in a future OS update. + set usesClassicLoadingMode(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPMaximumConnectionsPerHost', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.setUsesClassicLoadingMode:', + iOS: (false, (18, 4, 0)), + macOS: (false, (15, 4, 0)), ); - return _objc_msgSend_1hz7y9r( - this.ref.pointer, - _sel_HTTPMaximumConnectionsPerHost, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setUsesClassicLoadingMode_, + value, ); } - /// The maximum number of simultaneous persistent connections per host - set HTTPMaximumConnectionsPerHost(DartNSInteger value) { + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + set waitsForConnectivity(bool value) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPMaximumConnectionsPerHost:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.setWaitsForConnectivity:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - _objc_msgSend_4sp4xj( - this.ref.pointer, - _sel_setHTTPMaximumConnectionsPerHost_, + _objc_msgSend_1s56lr9( + object$.ref.pointer, + _sel_setWaitsForConnectivity_, value, ); } - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - NSHTTPCookieStorage? get HTTPCookieStorage { + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + objc.NSString? get sharedContainerIdentifier { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.HTTPCookieStorage', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.sharedContainerIdentifier', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_HTTPCookieStorage, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_sharedContainerIdentifier, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : NSHTTPCookieStorage.castFromPointer( - _ret, - retain: true, - release: true, - ); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - set HTTPCookieStorage(NSHTTPCookieStorage? value) { + /// shouldUseExtendedBackgroundIdleMode + bool get shouldUseExtendedBackgroundIdleMode { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setHTTPCookieStorage:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSessionConfiguration.shouldUseExtendedBackgroundIdleMode', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setHTTPCookieStorage_, - value?.ref.pointer ?? ffi.nullptr, + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_shouldUseExtendedBackgroundIdleMode, ); } - /// The credential storage object, or nil to indicate that no credential storage is to be used - NSURLCredentialStorage? get URLCredentialStorage { + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + DartNSTimeInterval get timeoutIntervalForRequest { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.URLCredentialStorage', + 'NSURLSessionConfiguration.timeoutIntervalForRequest', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_URLCredentialStorage, - ); - return _ret.address == 0 - ? null - : NSURLCredentialStorage.castFromPointer( - _ret, - retain: true, - release: true, + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + object$.ref.pointer, + _sel_timeoutIntervalForRequest, + ) + : _objc_msgSend_1ukqyt8( + object$.ref.pointer, + _sel_timeoutIntervalForRequest, ); } - /// The credential storage object, or nil to indicate that no credential storage is to be used - set URLCredentialStorage(NSURLCredentialStorage? value) { + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + DartNSTimeInterval get timeoutIntervalForResource { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setURLCredentialStorage:', + 'NSURLSessionConfiguration.timeoutIntervalForResource', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setURLCredentialStorage_, - value?.ref.pointer ?? ffi.nullptr, - ); - } - - /// The URL resource cache, or nil to indicate that no caching is to be performed - NSURLCache? get URLCache { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.URLCache', + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + object$.ref.pointer, + _sel_timeoutIntervalForResource, + ) + : _objc_msgSend_1ukqyt8( + object$.ref.pointer, + _sel_timeoutIntervalForResource, + ); + } + + /// Uses the classic network loader. + /// + /// NOTE: FTP and HTTP/1 pipelining are only supported in the classic loading mode. + /// + /// Defaults to YES. The default may be NO in a future OS update. + bool get usesClassicLoadingMode { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.usesClassicLoadingMode', + iOS: (false, (18, 4, 0)), + macOS: (false, (15, 4, 0)), + ); + return _objc_msgSend_91o635( + object$.ref.pointer, + _sel_usesClassicLoadingMode, + ); + } + + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + bool get waitsForConnectivity { + objc.checkOsVersionInternal( + 'NSURLSessionConfiguration.waitsForConnectivity', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_waitsForConnectivity); + } +} + +late final _sel_sessionWithConfiguration_ = objc.registerName( + "sessionWithConfiguration:", +); + +/// WARNING: NSURLSessionDelegate is a stub. To generate bindings for this class, include +/// NSURLSessionDelegate in your config's objc-protocols list. +/// +/// Messages related to the URL session as a whole +extension type NSURLSessionDelegate._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, objc.NSObjectProtocol { + /// Constructs a [NSURLSessionDelegate] that points to the same underlying object as [other]. + NSURLSessionDelegate.as(objc.ObjCObject other) : object$ = other; + + /// Constructs a [NSURLSessionDelegate] that wraps the given raw object pointer. + NSURLSessionDelegate.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); +} + +late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); + +/// WARNING: NSOperation is a stub. To generate bindings for this class, include +/// NSOperation in your config's objc-interfaces list. +/// +/// NSOperation +extension type NSOperation._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSOperation] that points to the same underlying object as [other]. + NSOperation.as(objc.ObjCObject other) : object$ = other { + objc.checkOsVersionInternal( + 'NSOperation', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + } + + /// Constructs a [NSOperation] that wraps the given raw object pointer. + NSOperation.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSOperation', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + } +} + +late final _sel_addOperation_ = objc.registerName("addOperation:"); +late final _sel_addOperations_waitUntilFinished_ = objc.registerName( + "addOperations:waitUntilFinished:", +); +final _objc_msgSend_6p7ndb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ) + >(); +late final _sel_addOperationWithBlock_ = objc.registerName( + "addOperationWithBlock:", +); +final _objc_msgSend_f167m6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); +late final _sel_maxConcurrentOperationCount = objc.registerName( + "maxConcurrentOperationCount", +); +late final _sel_setMaxConcurrentOperationCount_ = objc.registerName( + "setMaxConcurrentOperationCount:", +); +late final _sel_isSuspended = objc.registerName("isSuspended"); +late final _sel_setSuspended_ = objc.registerName("setSuspended:"); +late final _sel_name = objc.registerName("name"); +late final _sel_setName_ = objc.registerName("setName:"); +late final _sel_qualityOfService = objc.registerName("qualityOfService"); +final _objc_msgSend_oi8iq9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ) + >(); +late final _sel_setQualityOfService_ = objc.registerName( + "setQualityOfService:", +); +final _objc_msgSend_n2da1l = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ) + >(); +late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); +late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); +late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); +late final _sel_waitUntilAllOperationsAreFinished = objc.registerName( + "waitUntilAllOperationsAreFinished", +); +late final _sel_currentQueue = objc.registerName("currentQueue"); +late final _sel_mainQueue = objc.registerName("mainQueue"); +late final _sel_operations = objc.registerName("operations"); +late final _sel_operationCount = objc.registerName("operationCount"); + +/// NSDeprecated +extension NSDeprecated$3 on NSOperationQueue { + /// operationCount + DartNSUInteger get operationCount { + objc.checkOsVersionInternal( + 'NSOperationQueue.operationCount', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_operationCount); + } + + /// These two functions are inherently a race condition and should be avoided if possible + objc.NSArray get operations { + objc.checkOsVersionInternal( + 'NSOperationQueue.operations', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_operations); + return objc.NSArray.fromPointer($ret, retain: true, release: true); + } +} + +/// NSOperationQueue +extension type NSOperationQueue._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject, NSProgressReporting { + /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. + NSOperationQueue.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } + + /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. + NSOperationQueue.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSOperationQueue, + ); + + /// alloc + static NSOperationQueue alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_alloc); + return NSOperationQueue.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOperationQueue allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( + _class_NSOperationQueue, + _sel_allocWithZone_, + zone, + ); + return NSOperationQueue.fromPointer($ret, retain: false, release: true); + } + + /// currentQueue + static NSOperationQueue? getCurrentQueue() { + objc.checkOsVersionInternal( + 'NSOperationQueue.currentQueue', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + final $ret = _objc_msgSend_151sglz( + _class_NSOperationQueue, + _sel_currentQueue, + ); + return $ret.address == 0 + ? null + : NSOperationQueue.fromPointer($ret, retain: true, release: true); + } + + /// mainQueue + static NSOperationQueue getMainQueue() { + objc.checkOsVersionInternal( + 'NSOperationQueue.mainQueue', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + final $ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_mainQueue); + return NSOperationQueue.fromPointer($ret, retain: true, release: true); + } + + /// new + static NSOperationQueue new$() { + final $ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_new); + return NSOperationQueue.fromPointer($ret, retain: false, release: true); + } + + /// Returns a new instance of NSOperationQueue constructed with the default `new` method. + NSOperationQueue() : this.as(new$().object$); +} + +extension NSOperationQueue$Methods on NSOperationQueue { + /// @method addBarrierBlock: + /// @param barrier A block to execute + /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and + /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the + /// `dispatch_barrier_async` function. + void addBarrierBlock(objc.ObjCBlock barrier) { + objc.checkOsVersionInternal( + 'NSOperationQueue.addBarrierBlock:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + _objc_msgSend_f167m6( + object$.ref.pointer, + _sel_addBarrierBlock_, + barrier.ref.pointer, + ); + } + + /// addOperation: + void addOperation(NSOperation op) { + objc.checkOsVersionInternal( + 'NSOperationQueue.addOperation:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_addOperation_, + op.ref.pointer, + ); + } + + /// addOperationWithBlock: + void addOperationWithBlock(objc.ObjCBlock block) { + objc.checkOsVersionInternal( + 'NSOperationQueue.addOperationWithBlock:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + _objc_msgSend_f167m6( + object$.ref.pointer, + _sel_addOperationWithBlock_, + block.ref.pointer, + ); + } + + /// addOperations:waitUntilFinished: + void addOperations(objc.NSArray ops, {required bool waitUntilFinished}) { + objc.checkOsVersionInternal( + 'NSOperationQueue.addOperations:waitUntilFinished:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + _objc_msgSend_6p7ndb( + object$.ref.pointer, + _sel_addOperations_waitUntilFinished_, + ops.ref.pointer, + waitUntilFinished, + ); + } + + /// cancelAllOperations + void cancelAllOperations() { + objc.checkOsVersionInternal( + 'NSOperationQueue.cancelAllOperations', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_cancelAllOperations); + } + + /// init + NSOperationQueue init() { + objc.checkOsVersionInternal( + 'NSOperationQueue.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSOperationQueue.fromPointer($ret, retain: false, release: true); + } + + /// isSuspended + bool get isSuspended { + objc.checkOsVersionInternal( + 'NSOperationQueue.isSuspended', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + return _objc_msgSend_91o635(object$.ref.pointer, _sel_isSuspended); + } + + /// maxConcurrentOperationCount + DartNSInteger get maxConcurrentOperationCount { + objc.checkOsVersionInternal( + 'NSOperationQueue.maxConcurrentOperationCount', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + return _objc_msgSend_1hz7y9r( + object$.ref.pointer, + _sel_maxConcurrentOperationCount, + ); + } + + /// name + objc.NSString? get name { + objc.checkOsVersionInternal( + 'NSOperationQueue.name', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_name); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// progress + objc.NSProgress get progress { + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_progress); + return objc.NSProgress.fromPointer($ret, retain: true, release: true); + } + + /// qualityOfService + objc.NSQualityOfService get qualityOfService { + objc.checkOsVersionInternal( + 'NSOperationQueue.qualityOfService', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + final $ret = _objc_msgSend_oi8iq9( + object$.ref.pointer, + _sel_qualityOfService, + ); + return objc.NSQualityOfService.fromValue($ret); + } + + /// setMaxConcurrentOperationCount: + set maxConcurrentOperationCount(DartNSInteger value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setMaxConcurrentOperationCount:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + _objc_msgSend_4sp4xj( + object$.ref.pointer, + _sel_setMaxConcurrentOperationCount_, + value, + ); + } + + /// setName: + set name(objc.NSString? value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setName:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setName_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// setQualityOfService: + set qualityOfService(objc.NSQualityOfService value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setQualityOfService:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_n2da1l( + object$.ref.pointer, + _sel_setQualityOfService_, + value.value, + ); + } + + /// setSuspended: + set isSuspended(bool value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setSuspended:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + _objc_msgSend_1s56lr9(object$.ref.pointer, _sel_setSuspended_, value); + } + + /// actually retain + set underlyingQueue(Dartdispatch_queue_t? value) { + objc.checkOsVersionInternal( + 'NSOperationQueue.setUnderlyingQueue:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setUnderlyingQueue_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// actually retain + Dartdispatch_queue_t? get underlyingQueue { + objc.checkOsVersionInternal( + 'NSOperationQueue.underlyingQueue', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_underlyingQueue, + ); + return $ret.address == 0 + ? null + : objc.NSObject.fromPointer($ret, retain: true, release: true); + } + + /// waitUntilAllOperationsAreFinished + void waitUntilAllOperationsAreFinished() { + objc.checkOsVersionInternal( + 'NSOperationQueue.waitUntilAllOperationsAreFinished', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + _objc_msgSend_1pl9qdv( + object$.ref.pointer, + _sel_waitUntilAllOperationsAreFinished, + ); + } +} + +late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = objc + .registerName("sessionWithConfiguration:delegate:delegateQueue:"); +late final _sel_delegateQueue = objc.registerName("delegateQueue"); +late final _sel_configuration = objc.registerName("configuration"); +late final _sel_sessionDescription = objc.registerName("sessionDescription"); +late final _sel_setSessionDescription_ = objc.registerName( + "setSessionDescription:", +); +late final _sel_finishTasksAndInvalidate = objc.registerName( + "finishTasksAndInvalidate", +); +late final _sel_invalidateAndCancel = objc.registerName("invalidateAndCancel"); +late final _sel_resetWithCompletionHandler_ = objc.registerName( + "resetWithCompletionHandler:", +); +late final _sel_flushWithCompletionHandler_ = objc.registerName( + "flushWithCompletionHandler:", +); + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > + fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + >(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + >( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > + fromFunction( + void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + >( + objc.newClosureBlock( + _closureCallable, + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + objc.NSArray.fromPointer(arg0, retain: true, release: true), + objc.NSArray.fromPointer(arg1, retain: true, release: true), + objc.NSArray.fromPointer(arg2, retain: true, release: true), + ), + keepIsolateAlive, + ), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > + listener( + void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + objc.NSArray.fromPointer(arg0, retain: false, release: true), + objc.NSArray.fromPointer(arg1, retain: false, release: true), + objc.NSArray.fromPointer(arg2, retain: false, release: true), + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + >(wrapper, retain: false, release: true); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > + blocking( + void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + objc.NSArray.fromPointer(arg0, retain: false, release: true), + objc.NSArray.fromPointer(arg1, retain: false, release: true), + objc.NSArray.fromPointer(arg2, retain: false, release: true), + ), + keepIsolateAlive, + ); + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + objc.NSArray.fromPointer(arg0, retain: false, release: true), + objc.NSArray.fromPointer(arg1, retain: false, release: true), + objc.NSArray.fromPointer(arg2, retain: false, release: true), + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + raw, + rawListener, + objc.objCContext, + ); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + >(wrapper, retain: false, release: true); + } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSArray_NSArray_NSArray$CallExtension + on + objc.ObjCBlock< + ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + > { + void call(objc.NSArray arg0, objc.NSArray arg1, objc.NSArray arg2) => ref + .pointer + .ref + .invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); +} + +late final _sel_getTasksWithCompletionHandler_ = objc.registerName( + "getTasksWithCompletionHandler:", +); + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSArray { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock( + pointer, + retain: retain, + release: release, + ); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + > + ptr, + ) => objc.ObjCBlock( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock fromFunction( + void Function(objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer arg0) => + fn(objc.NSArray.fromPointer(arg0, retain: true, release: true)), + keepIsolateAlive, + ), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener( + void Function(objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => + fn(objc.NSArray.fromPointer(arg0, retain: false, release: true)), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, + ); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock blocking( + void Function(objc.NSArray) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => + fn(objc.NSArray.fromPointer(arg0, retain: false, release: true)), + keepIsolateAlive, + ); + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => + fn(objc.NSArray.fromPointer(arg0, retain: false, release: true)), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, + rawListener, + objc.objCContext, + ); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, + ); + } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSArray$CallExtension + on objc.ObjCBlock { + void call(objc.NSArray arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0.ref.pointer); +} + +late final _sel_getAllTasksWithCompletionHandler_ = objc.registerName( + "getAllTasksWithCompletionHandler:", +); +late final _sel_dataTaskWithRequest_ = objc.registerName( + "dataTaskWithRequest:", +); +late final _sel_dataTaskWithURL_ = objc.registerName("dataTaskWithURL:"); + +/// WARNING: NSURLSessionUploadTask is a stub. To generate bindings for this class, include +/// NSURLSessionUploadTask in your config's objc-interfaces list. +/// +/// An NSURLSessionUploadTask does not currently provide any additional +/// functionality over an NSURLSessionDataTask. All delegate messages +/// that may be sent referencing an NSURLSessionDataTask equally apply +/// to NSURLSessionUploadTasks. +extension type NSURLSessionUploadTask._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLSessionDataTask { + /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + NSURLSessionUploadTask.as(objc.ObjCObject other) : object$ = other { + objc.checkOsVersionInternal( + 'NSURLSessionUploadTask', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_URLCache); - return _ret.address == 0 - ? null - : NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// The URL resource cache, or nil to indicate that no caching is to be performed - set URLCache(NSURLCache? value) { + /// Constructs a [NSURLSessionUploadTask] that wraps the given raw object pointer. + NSURLSessionUploadTask.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setURLCache:', + 'NSURLSessionUploadTask', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setURLCache_, - value?.ref.pointer ?? ffi.nullptr, - ); } +} - /// shouldUseExtendedBackgroundIdleMode - bool get shouldUseExtendedBackgroundIdleMode { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.shouldUseExtendedBackgroundIdleMode', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), - ); - return _objc_msgSend_91o635( - this.ref.pointer, - _sel_shouldUseExtendedBackgroundIdleMode, - ); - } +late final _sel_uploadTaskWithRequest_fromFile_ = objc.registerName( + "uploadTaskWithRequest:fromFile:", +); +late final _sel_uploadTaskWithRequest_fromData_ = objc.registerName( + "uploadTaskWithRequest:fromData:", +); +late final _sel_uploadTaskWithResumeData_ = objc.registerName( + "uploadTaskWithResumeData:", +); +late final _sel_uploadTaskWithStreamedRequest_ = objc.registerName( + "uploadTaskWithStreamedRequest:", +); +late final _class_NSURLSessionDownloadTask = objc.getClass( + "NSURLSessionDownloadTask", +); - /// setShouldUseExtendedBackgroundIdleMode: - set shouldUseExtendedBackgroundIdleMode(bool value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setShouldUseExtendedBackgroundIdleMode:', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), - ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setShouldUseExtendedBackgroundIdleMode_, - value, - ); - } +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock( + pointer, + retain: retain, + release: release, + ); - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - objc.NSArray? get protocolClasses { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.protocolClasses', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_protocolClasses); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + > + ptr, + ) => objc.ObjCBlock( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - set protocolClasses(objc.NSArray? value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setProtocolClasses:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSData.fromPointer(arg0, retain: true, release: true), + ), + keepIsolateAlive, + ), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener( + void Function(objc.NSData?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSData.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setProtocolClasses_, - value?.ref.pointer ?? ffi.nullptr, + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); } - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - NSURLSessionMultipathServiceType get multipathServiceType { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.multipathServiceType', - iOS: (false, (11, 0, 0)), - macOS: (true, null), + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock blocking( + void Function(objc.NSData?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSData.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - final _ret = _objc_msgSend_1wxwnc0( - this.ref.pointer, - _sel_multipathServiceType, + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSData.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - return NSURLSessionMultipathServiceType.fromValue(_ret); - } - - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - set multipathServiceType(NSURLSessionMultipathServiceType value) { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setMultipathServiceType:', - iOS: (false, (11, 0, 0)), - macOS: (true, null), + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, + rawListener, + objc.objCContext, ); - _objc_msgSend_1hx005a( - this.ref.pointer, - _sel_setMultipathServiceType_, - value.value, + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); } - /// Uses the classic network loader. - /// - /// NOTE: FTP and HTTP/1 pipelining are only supported in the classic loading mode. - /// - /// Defaults to YES. The default may be NO in a future OS update. - bool get usesClassicLoadingMode { - objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.usesClassicLoadingMode', - iOS: (false, (18, 4, 0)), - macOS: (false, (15, 4, 0)), - ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_usesClassicLoadingMode); + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); } - /// Uses the classic network loader. - /// - /// NOTE: FTP and HTTP/1 pipelining are only supported in the classic loading mode. - /// - /// Defaults to YES. The default may be NO in a future OS update. - set usesClassicLoadingMode(bool value) { + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData$CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_cancelByProducingResumeData_ = objc.registerName( + "cancelByProducingResumeData:", +); + +/// NSURLSessionDownloadTask is a task that represents a download to +/// local storage. +extension type NSURLSessionDownloadTask._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLSessionTask { + /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + NSURLSessionDownloadTask.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.setUsesClassicLoadingMode:', - iOS: (false, (18, 4, 0)), - macOS: (false, (15, 4, 0)), - ); - _objc_msgSend_1s56lr9( - this.ref.pointer, - _sel_setUsesClassicLoadingMode_, - value, + 'NSURLSessionDownloadTask', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); + assert(isA(object$)); } - /// init - NSURLSessionConfiguration init() { + /// Constructs a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + NSURLSessionDownloadTask.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSURLSessionConfiguration.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: false, - release: true, + 'NSURLSessionDownloadTask', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); + assert(isA(object$)); } - /// new - static NSURLSessionConfiguration new$() { - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionConfiguration, - _sel_new, + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSessionDownloadTask, + ); + + /// alloc + static NSURLSessionDownloadTask alloc() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionDownloadTask, + _sel_alloc, ); - return NSURLSessionConfiguration.castFromPointer( - _ret, + return NSURLSessionDownloadTask.fromPointer( + $ret, retain: false, release: true, ); } /// allocWithZone: - static NSURLSessionConfiguration allocWithZone( - ffi.Pointer zone, - ) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSessionConfiguration, + static NSURLSessionDownloadTask allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLSessionDownloadTask, _sel_allocWithZone_, zone, ); - return NSURLSessionConfiguration.castFromPointer( - _ret, + return NSURLSessionDownloadTask.fromPointer( + $ret, retain: false, release: true, ); } - /// alloc - static NSURLSessionConfiguration alloc() { - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionConfiguration, - _sel_alloc, + /// new + static NSURLSessionDownloadTask new$() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionDownloadTask, + _sel_new, ); - return NSURLSessionConfiguration.castFromPointer( - _ret, + return NSURLSessionDownloadTask.fromPointer( + $ret, retain: false, release: true, ); } - /// self - NSURLSessionConfiguration self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, - ); - } + /// Returns a new instance of NSURLSessionDownloadTask constructed with the default `new` method. + NSURLSessionDownloadTask() : this.as(new$().object$); +} - /// retain - NSURLSessionConfiguration retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, - release: true, +extension NSURLSessionDownloadTask$Methods on NSURLSessionDownloadTask { + /// Cancel the download (and calls the superclass -cancel). If + /// conditions will allow for resuming the download in the future, the + /// callback will be called with an opaque data blob, which may be used + /// with -downloadTaskWithResumeData: to attempt to resume the download. + /// If resume data cannot be created, the completion handler will be + /// called with nil resumeData. + void cancelByProducingResumeData( + objc.ObjCBlock completionHandler, + ) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadTask.cancelByProducingResumeData:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_f167m6( + object$.ref.pointer, + _sel_cancelByProducingResumeData_, + completionHandler.ref.pointer, ); } - /// autorelease - NSURLSessionConfiguration autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSessionConfiguration.castFromPointer( - _ret, - retain: true, + /// init + NSURLSessionDownloadTask init() { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadTask.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: false, release: true, ); } - - /// Returns a new instance of NSURLSessionConfiguration constructed with the default `new` method. - factory NSURLSessionConfiguration() => new$(); } -late final _sel_sessionWithConfiguration_ = objc.registerName( - "sessionWithConfiguration:", +late final _sel_downloadTaskWithRequest_ = objc.registerName( + "downloadTaskWithRequest:", +); +late final _sel_downloadTaskWithURL_ = objc.registerName( + "downloadTaskWithURL:", +); +late final _sel_downloadTaskWithResumeData_ = objc.registerName( + "downloadTaskWithResumeData:", ); -/// WARNING: NSURLSessionDelegate is a stub. To generate bindings for this class, include -/// NSURLSessionDelegate in your config's objc-protocols list. +/// WARNING: NSURLSessionStreamTask is a stub. To generate bindings for this class, include +/// NSURLSessionStreamTask in your config's objc-interfaces list. /// -/// Messages related to the URL session as a whole -interface class NSURLSessionDelegate extends objc.ObjCProtocolBase - implements objc.NSObjectProtocol { - NSURLSessionDelegate._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionDelegate] that points to the same underlying object as [other]. - NSURLSessionDelegate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionDelegate] that wraps the given raw object pointer. - NSURLSessionDelegate.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - -late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); -late final _sel_operations = objc.registerName("operations"); -late final _sel_operationCount = objc.registerName("operationCount"); - -/// NSDeprecated -extension NSDeprecated$1 on NSOperationQueue { - /// These two functions are inherently a race condition and should be avoided if possible - objc.NSArray get operations { - objc.checkOsVersionInternal( - 'NSOperationQueue.operations', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_operations); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// operationCount - DartNSUInteger get operationCount { +/// An NSURLSessionStreamTask provides an interface to perform reads +/// and writes to a TCP/IP stream created via NSURLSession. This task +/// may be explicitly created from an NSURLSession, or created as a +/// result of the appropriate disposition response to a +/// -URLSession:dataTask:didReceiveResponse: delegate message. +/// +/// NSURLSessionStreamTask can be used to perform asynchronous reads +/// and writes. Reads and writes are enqueued and executed serially, +/// with the completion handler being invoked on the sessions delegate +/// queue. If an error occurs, or the task is canceled, all +/// outstanding read and write calls will have their completion +/// handlers invoked with an appropriate error. +/// +/// It is also possible to create NSInputStream and NSOutputStream +/// instances from an NSURLSessionTask by sending +/// -captureStreams to the task. All outstanding reads and writes are +/// completed before the streams are created. Once the streams are +/// delivered to the session delegate, the task is considered complete +/// and will receive no more messages. These streams are +/// disassociated from the underlying session. +extension type NSURLSessionStreamTask._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLSessionTask { + /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + NSURLSessionStreamTask.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( - 'NSOperationQueue.operationCount', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + 'NSURLSessionStreamTask', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_operationCount); } -} -/// WARNING: NSOperation is a stub. To generate bindings for this class, include -/// NSOperation in your config's objc-interfaces list. -/// -/// NSOperation -class NSOperation extends objc.NSObject { - NSOperation._( - ffi.Pointer pointer, { + /// Constructs a [NSURLSessionStreamTask] that wraps the given raw object pointer. + NSURLSessionStreamTask.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSOperation', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), + 'NSURLSessionStreamTask', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); } - - /// Constructs a [NSOperation] that points to the same underlying object as [other]. - NSOperation.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSOperation] that wraps the given raw object pointer. - NSOperation.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); } -late final _sel_addOperation_ = objc.registerName("addOperation:"); -late final _sel_addOperations_waitUntilFinished_ = objc.registerName( - "addOperations:waitUntilFinished:", +late final _sel_streamTaskWithHostName_port_ = objc.registerName( + "streamTaskWithHostName:port:", ); -final _objc_msgSend_6p7ndb = objc.msgSendPointer +final _objc_msgSend_9slupp = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Bool, + ffi.Pointer, + ffi.Long, ) > >() .asFunction< - void Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - bool, + ffi.Pointer, + int, ) >(); -late final _sel_addOperationWithBlock_ = objc.registerName( - "addOperationWithBlock:", -); -late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); -late final _sel_maxConcurrentOperationCount = objc.registerName( - "maxConcurrentOperationCount", + +/// WARNING: NSNetService is a stub. To generate bindings for this class, include +/// NSNetService in your config's objc-interfaces list. +/// +/// NSNetService +extension type NSNetService._(objc.ObjCObject object$) + implements objc.ObjCObject { + /// Constructs a [NSNetService] that points to the same underlying object as [other]. + NSNetService.as(objc.ObjCObject other) : object$ = other {} + + /// Constructs a [NSNetService] that wraps the given raw object pointer. + NSNetService.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} +} + +late final _sel_streamTaskWithNetService_ = objc.registerName( + "streamTaskWithNetService:", ); -late final _sel_setMaxConcurrentOperationCount_ = objc.registerName( - "setMaxConcurrentOperationCount:", +late final _class_NSURLSessionWebSocketTask = objc.getClass( + "NSURLSessionWebSocketTask", ); -late final _sel_isSuspended = objc.registerName("isSuspended"); -late final _sel_setSuspended_ = objc.registerName("setSuspended:"); -late final _sel_name = objc.registerName("name"); -late final _sel_setName_ = objc.registerName("setName:"); -late final _sel_qualityOfService = objc.registerName("qualityOfService"); -final _objc_msgSend_oi8iq9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_setQualityOfService_ = objc.registerName( - "setQualityOfService:", +late final _class_NSURLSessionWebSocketMessage = objc.getClass( + "NSURLSessionWebSocketMessage", ); -final _objc_msgSend_n2da1l = objc.msgSendPointer +late final _sel_initWithData_ = objc.registerName("initWithData:"); +late final _sel_initWithString_ = objc.registerName("initWithString:"); + +enum NSURLSessionWebSocketMessageType { + NSURLSessionWebSocketMessageTypeData(0), + NSURLSessionWebSocketMessageTypeString(1); + + final int value; + const NSURLSessionWebSocketMessageType(this.value); + + static NSURLSessionWebSocketMessageType fromValue(int value) => + switch (value) { + 0 => NSURLSessionWebSocketMessageTypeData, + 1 => NSURLSessionWebSocketMessageTypeString, + _ => throw ArgumentError( + 'Unknown value for NSURLSessionWebSocketMessageType: $value', + ), + }; +} + +late final _sel_type = objc.registerName("type"); +final _objc_msgSend_1qouven = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, + NSInteger Function( + ffi.Pointer, ffi.Pointer, - NSInteger, ) > >() .asFunction< - void Function( - ffi.Pointer, + int Function( + ffi.Pointer, ffi.Pointer, - int, ) >(); -late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); -late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); -late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); -late final _sel_waitUntilAllOperationsAreFinished = objc.registerName( - "waitUntilAllOperationsAreFinished", -); -late final _sel_currentQueue = objc.registerName("currentQueue"); -late final _sel_mainQueue = objc.registerName("mainQueue"); - -/// NSOperationQueue -class NSOperationQueue extends objc.NSObject implements NSProgressReporting { - NSOperationQueue._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); +late final _sel_data = objc.registerName("data"); +late final _sel_string = objc.registerName("string"); - /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. - NSOperationQueue.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +/// The client can create a WebSocket message object that will be passed to the send calls +/// and will be delivered from the receive calls. The message can be initialized with data or string. +/// If initialized with data, the string property will be nil and vice versa. +extension type NSURLSessionWebSocketMessage._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + NSURLSessionWebSocketMessage.as(objc.ObjCObject other) : object$ = other { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketMessage', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + assert(isA(object$)); + } - /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. - NSOperationQueue.castFromPointer( - ffi.Pointer other, { + /// Constructs a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + NSURLSessionWebSocketMessage.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSOperationQueue]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSOperationQueue, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketMessage', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); + assert(isA(object$)); } - /// progress - objc.NSProgress get progress { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_progress); - return objc.NSProgress.castFromPointer(_ret, retain: true, release: true); - } + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSessionWebSocketMessage, + ); - /// addOperation: - void addOperation(NSOperation op) { - objc.checkOsVersionInternal( - 'NSOperationQueue.addOperation:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), + /// alloc + static NSURLSessionWebSocketMessage alloc() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionWebSocketMessage, + _sel_alloc, + ); + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); - _objc_msgSend_xtuoz7(this.ref.pointer, _sel_addOperation_, op.ref.pointer); } - /// addOperations:waitUntilFinished: - void addOperations(objc.NSArray ops, {required bool waitUntilFinished}) { - objc.checkOsVersionInternal( - 'NSOperationQueue.addOperations:waitUntilFinished:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + /// allocWithZone: + static NSURLSessionWebSocketMessage allocWithZone( + ffi.Pointer zone, + ) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLSessionWebSocketMessage, + _sel_allocWithZone_, + zone, ); - _objc_msgSend_6p7ndb( - this.ref.pointer, - _sel_addOperations_waitUntilFinished_, - ops.ref.pointer, - waitUntilFinished, + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); } - /// addOperationWithBlock: - void addOperationWithBlock(objc.ObjCBlock block) { - objc.checkOsVersionInternal( - 'NSOperationQueue.addOperationWithBlock:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + /// new + static NSURLSessionWebSocketMessage new$() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionWebSocketMessage, + _sel_new, ); - _objc_msgSend_f167m6( - this.ref.pointer, - _sel_addOperationWithBlock_, - block.ref.pointer, + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); } - /// @method addBarrierBlock: - /// @param barrier A block to execute - /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and - /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the - /// `dispatch_barrier_async` function. - void addBarrierBlock(objc.ObjCBlock barrier) { + /// Returns a new instance of NSURLSessionWebSocketMessage constructed with the default `new` method. + NSURLSessionWebSocketMessage() : this.as(new$().object$); +} + +extension NSURLSessionWebSocketMessage$Methods on NSURLSessionWebSocketMessage { + /// data + objc.NSData? get data { objc.checkOsVersionInternal( - 'NSOperationQueue.addBarrierBlock:', + 'NSURLSessionWebSocketMessage.data', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - _objc_msgSend_f167m6( - this.ref.pointer, - _sel_addBarrierBlock_, - barrier.ref.pointer, - ); - } - - /// maxConcurrentOperationCount - DartNSInteger get maxConcurrentOperationCount { - objc.checkOsVersionInternal( - 'NSOperationQueue.maxConcurrentOperationCount', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - return _objc_msgSend_1hz7y9r( - this.ref.pointer, - _sel_maxConcurrentOperationCount, - ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_data); + return $ret.address == 0 + ? null + : objc.NSData.fromPointer($ret, retain: true, release: true); } - /// setMaxConcurrentOperationCount: - set maxConcurrentOperationCount(DartNSInteger value) { + /// init + NSURLSessionWebSocketMessage init() { objc.checkOsVersionInternal( - 'NSOperationQueue.setMaxConcurrentOperationCount:', + 'NSURLSessionWebSocketMessage.init', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - _objc_msgSend_4sp4xj( - this.ref.pointer, - _sel_setMaxConcurrentOperationCount_, - value, + macOS: (false, (10, 0, 0)), ); - } - - /// isSuspended - bool get suspended { - objc.checkOsVersionInternal( - 'NSOperationQueue.isSuspended', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); - return _objc_msgSend_91o635(this.ref.pointer, _sel_isSuspended); - } - - /// setSuspended: - set suspended(bool value) { - objc.checkOsVersionInternal( - 'NSOperationQueue.setSuspended:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); - _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setSuspended_, value); } - /// name - objc.NSString? get name { + /// Create a message with data type + NSURLSessionWebSocketMessage initWithData(objc.NSData data) { objc.checkOsVersionInternal( - 'NSOperationQueue.name', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + 'NSURLSessionWebSocketMessage.initWithData:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setName: - set name(objc.NSString? value) { - objc.checkOsVersionInternal( - 'NSOperationQueue.setName:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithData_, + data.ref.pointer, ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setName_, - value?.ref.pointer ?? ffi.nullptr, + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); } - /// qualityOfService - objc.NSQualityOfService get qualityOfService { + /// Create a message with string type + NSURLSessionWebSocketMessage initWithString(objc.NSString string) { objc.checkOsVersionInternal( - 'NSOperationQueue.qualityOfService', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + 'NSURLSessionWebSocketMessage.initWithString:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_oi8iq9(this.ref.pointer, _sel_qualityOfService); - return objc.NSQualityOfService.fromValue(_ret); - } - - /// setQualityOfService: - set qualityOfService(objc.NSQualityOfService value) { - objc.checkOsVersionInternal( - 'NSOperationQueue.setQualityOfService:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithString_, + string.ref.pointer, ); - _objc_msgSend_n2da1l( - this.ref.pointer, - _sel_setQualityOfService_, - value.value, + return NSURLSessionWebSocketMessage.fromPointer( + $ret, + retain: false, + release: true, ); } - /// actually retain - Dartdispatch_queue_t? get underlyingQueue { + /// string + objc.NSString? get string { objc.checkOsVersionInternal( - 'NSOperationQueue.underlyingQueue', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), + 'NSURLSessionWebSocketMessage.string', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_underlyingQueue); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_string); + return $ret.address == 0 ? null - : objc.NSObject.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// actually retain - set underlyingQueue(Dartdispatch_queue_t? value) { + /// type + NSURLSessionWebSocketMessageType get type { objc.checkOsVersionInternal( - 'NSOperationQueue.setUnderlyingQueue:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setUnderlyingQueue_, - value?.ref.pointer ?? ffi.nullptr, + 'NSURLSessionWebSocketMessage.type', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); + final $ret = _objc_msgSend_1qouven(object$.ref.pointer, _sel_type); + return NSURLSessionWebSocketMessageType.fromValue($ret); } +} - /// cancelAllOperations - void cancelAllOperations() { - objc.checkOsVersionInternal( - 'NSOperationQueue.cancelAllOperations', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancelAllOperations); - } +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock( + pointer, + retain: retain, + release: release, + ); - /// waitUntilAllOperationsAreFinished - void waitUntilAllOperationsAreFinished() { - objc.checkOsVersionInternal( - 'NSOperationQueue.waitUntilAllOperationsAreFinished', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - _objc_msgSend_1pl9qdv( - this.ref.pointer, - _sel_waitUntilAllOperationsAreFinished, - ); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + > + ptr, + ) => objc.ObjCBlock( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); - /// currentQueue - static NSOperationQueue? getCurrentQueue() { - objc.checkOsVersionInternal( - 'NSOperationQueue.currentQueue', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock fromFunction( + void Function(objc.NSError?) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSError.fromPointer(arg0, retain: true, release: true), + ), + keepIsolateAlive, + ), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock listener( + void Function(objc.NSError?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSError.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - final _ret = _objc_msgSend_151sglz( - _class_NSOperationQueue, - _sel_currentQueue, + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); - return _ret.address == 0 - ? null - : NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - /// mainQueue - static NSOperationQueue getMainQueue() { - objc.checkOsVersionInternal( - 'NSOperationQueue.mainQueue', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock blocking( + void Function(objc.NSError?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSError.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_mainQueue); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSOperationQueue init() { - objc.checkOsVersionInternal( - 'NSOperationQueue.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( + arg0.address == 0 + ? null + : objc.NSError.fromPointer(arg0, retain: false, release: true), + ), + keepIsolateAlive, ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + raw, + rawListener, + objc.objCContext, ); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSOperationQueue new$() { - final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_new); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSOperationQueue allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSOperationQueue, - _sel_allocWithZone_, - zone, + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true, ); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSOperationQueue alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSOperationQueue, _sel_alloc); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSOperationQueue self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - /// retain - NSOperationQueue retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); } - /// autorelease - NSOperationQueue autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } } - /// Returns a new instance of NSOperationQueue constructed with the default `new` method. - factory NSOperationQueue() => new$(); -} - -late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = objc - .registerName("sessionWithConfiguration:delegate:delegateQueue:"); -late final _sel_delegateQueue = objc.registerName("delegateQueue"); -late final _sel_configuration = objc.registerName("configuration"); -late final _sel_sessionDescription = objc.registerName("sessionDescription"); -late final _sel_setSessionDescription_ = objc.registerName( - "setSessionDescription:", -); -late final _sel_finishTasksAndInvalidate = objc.registerName( - "finishTasksAndInvalidate", -); -late final _sel_invalidateAndCancel = objc.registerName("invalidateAndCancel"); -late final _sel_resetWithCompletionHandler_ = objc.registerName( - "resetWithCompletionHandler:", -); -late final _sel_flushWithCompletionHandler_ = objc.registerName( - "flushWithCompletionHandler:", -); -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrCallable = - ffi.Pointer.fromFunction< + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - >(_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureCallable = - ffi.Pointer.fromFunction< + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSError$CallExtension + on objc.ObjCBlock { + void call(objc.NSError? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ) + > + >() + .asFunction< + void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) - >.listener(_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingTrampoline) - ..keepIsolateAlive = false; + >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { +late final _sel_sendMessage_completionHandler_ = objc.registerName( + "sendMessage:completionHandler:", +); + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) >(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -67825,27 +67304,23 @@ abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) > fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -67859,25 +67334,31 @@ abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) > fromFunction( - void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.NSArray.castFromPointer(arg0, retain: true, release: true), - objc.NSArray.castFromPointer(arg1, retain: true, release: true), - objc.NSArray.castFromPointer(arg2, retain: true, release: true), + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.fromPointer( + arg0, + retain: true, + release: true, + ), + arg1.address == 0 + ? null + : objc.NSError.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -67895,30 +67376,35 @@ abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) > listener( - void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_listenerCallable.nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.NSArray.castFromPointer(arg0, retain: false, release: true), - objc.NSArray.castFromPointer(arg1, retain: false, release: true), - objc.NSArray.castFromPointer(arg2, retain: false, release: true), + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.fromPointer( + arg0, + retain: false, + release: true, + ), + arg1.address == 0 + ? null + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) >(wrapper, retain: false, release: true); } @@ -67933,42 +67419,51 @@ abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) > blocking( - void Function(objc.NSArray, objc.NSArray, objc.NSArray) fn, { + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingCallable.nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.NSArray.castFromPointer(arg0, retain: false, release: true), - objc.NSArray.castFromPointer(arg1, retain: false, release: true), - objc.NSArray.castFromPointer(arg2, retain: false, release: true), + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.fromPointer( + arg0, + retain: false, + release: true, + ), + arg1.address == 0 + ? null + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.NSArray.castFromPointer(arg0, retain: false, release: true), - objc.NSArray.castFromPointer(arg1, retain: false, release: true), - objc.NSArray.castFromPointer(arg2, retain: false, release: true), + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.fromPointer( + arg0, + retain: false, + release: true, + ), + arg1.address == 0 + ? null + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( raw, rawListener, objc.objCContext, @@ -67976,793 +67471,524 @@ abstract final class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray { objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) >(wrapper, retain: false, release: true); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_CallExtension - on - objc.ObjCBlock< - ffi.Void Function(objc.NSArray, objc.NSArray, objc.NSArray) - > { - void call(objc.NSArray arg0, objc.NSArray arg1, objc.NSArray arg2) => ref - .pointer - .ref - .invoke - .cast< - ffi.NativeFunction< + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); -} + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } -late final _sel_getTasksWithCompletionHandler_ = objc.registerName( - "getTasksWithCompletionHandler:", -); -void _ObjCBlock_ffiVoid_NSArray$1_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray$1_fnPtrCallable = - ffi.Pointer.fromFunction< + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - >(_ObjCBlock_ffiVoid_NSArray$1_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray$1_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray$1_closureCallable = - ffi.Pointer.fromFunction< + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSArray$1_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSArray$1_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray$1_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSArray$1_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSArray$1_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray$1_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSArray$1_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSArray$1_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSArray$1_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSArray$1 { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => objc.ObjCBlock( - pointer, - retain: retain, - release: release, - ); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction arg0)> - > - ptr, - ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSArray$1_fnPtrCallable, - ptr.cast(), - ), - retain: false, - release: true, - ); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock fromFunction( - void Function(objc.NSArray) fn, { - bool keepIsolateAlive = true, - }) => objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray$1_closureCallable, - (ffi.Pointer arg0) => - fn(objc.NSArray.castFromPointer(arg0, retain: true, release: true)), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock listener( - void Function(objc.NSArray) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray$1_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => - fn(objc.NSArray.castFromPointer(arg0, retain: false, release: true)), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking( - void Function(objc.NSArray) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray$1_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => - fn(objc.NSArray.castFromPointer(arg0, retain: false, release: true)), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray$1_blockingListenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => - fn(objc.NSArray.castFromPointer(arg0, retain: false, release: true)), - keepIsolateAlive, - ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( - raw, - rawListener, - objc.objCContext, - ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSArray$1_CallExtension - on objc.ObjCBlock { - void call(objc.NSArray arg0) => ref.pointer.ref.invoke + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - >()(ref.pointer, arg0.ref.pointer); + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -late final _sel_getAllTasksWithCompletionHandler_ = objc.registerName( - "getAllTasksWithCompletionHandler:", -); -late final _sel_dataTaskWithRequest_ = objc.registerName( - "dataTaskWithRequest:", -); -late final _sel_dataTaskWithURL_ = objc.registerName("dataTaskWithURL:"); -late final _sel_uploadTaskWithRequest_fromFile_ = objc.registerName( - "uploadTaskWithRequest:fromFile:", -); -late final _sel_uploadTaskWithRequest_fromData_ = objc.registerName( - "uploadTaskWithRequest:fromData:", -); -late final _sel_uploadTaskWithResumeData_ = objc.registerName( - "uploadTaskWithResumeData:", -); -late final _sel_uploadTaskWithStreamedRequest_ = objc.registerName( - "uploadTaskWithStreamedRequest:", -); -late final _sel_downloadTaskWithRequest_ = objc.registerName( - "downloadTaskWithRequest:", -); -late final _sel_downloadTaskWithURL_ = objc.registerName( - "downloadTaskWithURL:", +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError$CallExtension + on + objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + > { + void call(NSURLSessionWebSocketMessage? arg0, objc.NSError? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()( + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + ); +} + +late final _sel_receiveMessageWithCompletionHandler_ = objc.registerName( + "receiveMessageWithCompletionHandler:", ); -late final _sel_downloadTaskWithResumeData_ = objc.registerName( - "downloadTaskWithResumeData:", +late final _sel_sendPingWithPongReceiveHandler_ = objc.registerName( + "sendPingWithPongReceiveHandler:", ); -/// WARNING: NSURLSessionStreamTask is a stub. To generate bindings for this class, include -/// NSURLSessionStreamTask in your config's objc-interfaces list. -/// -/// An NSURLSessionStreamTask provides an interface to perform reads -/// and writes to a TCP/IP stream created via NSURLSession. This task -/// may be explicitly created from an NSURLSession, or created as a -/// result of the appropriate disposition response to a -/// -URLSession:dataTask:didReceiveResponse: delegate message. -/// -/// NSURLSessionStreamTask can be used to perform asynchronous reads -/// and writes. Reads and writes are enqueued and executed serially, -/// with the completion handler being invoked on the sessions delegate -/// queue. If an error occurs, or the task is canceled, all -/// outstanding read and write calls will have their completion -/// handlers invoked with an appropriate error. -/// -/// It is also possible to create NSInputStream and NSOutputStream -/// instances from an NSURLSessionTask by sending -/// -captureStreams to the task. All outstanding reads and writes are -/// completed before the streams are created. Once the streams are -/// delivered to the session delegate, the task is considered complete -/// and will receive no more messages. These streams are -/// disassociated from the underlying session. -class NSURLSessionStreamTask extends NSURLSessionTask { - NSURLSessionStreamTask._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { - objc.checkOsVersionInternal( - 'NSURLSessionStreamTask', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), - ); - } - - /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. - NSURLSessionStreamTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionStreamTask] that wraps the given raw object pointer. - NSURLSessionStreamTask.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); +/// The WebSocket close codes follow the close codes given in the RFC +sealed class NSURLSessionWebSocketCloseCode { + static const NSURLSessionWebSocketCloseCodeInvalid = 0; + static const NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010; + static const NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; } -late final _sel_streamTaskWithHostName_port_ = objc.registerName( - "streamTaskWithHostName:port:", +late final _sel_cancelWithCloseCode_reason_ = objc.registerName( + "cancelWithCloseCode:reason:", ); -final _objc_msgSend_9slupp = objc.msgSendPointer +final _objc_msgSend_tqzk0b = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Long, + NSInteger, + ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + void Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, + ffi.Pointer, ) >(); - -/// WARNING: NSNetService is a stub. To generate bindings for this class, include -/// NSNetService in your config's objc-interfaces list. -/// -/// NSNetService -class NSNetService extends objc.ObjCObjectBase { - NSNetService._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - - /// Constructs a [NSNetService] that points to the same underlying object as [other]. - NSNetService.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSNetService] that wraps the given raw object pointer. - NSNetService.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); -} - -late final _sel_streamTaskWithNetService_ = objc.registerName( - "streamTaskWithNetService:", -); -late final _class_NSURLSessionWebSocketTask = objc.getClass( - "NSURLSessionWebSocketTask", -); -late final _class_NSURLSessionWebSocketMessage = objc.getClass( - "NSURLSessionWebSocketMessage", +late final _sel_maximumMessageSize = objc.registerName("maximumMessageSize"); +late final _sel_setMaximumMessageSize_ = objc.registerName( + "setMaximumMessageSize:", ); -late final _sel_initWithData_ = objc.registerName("initWithData:"); -late final _sel_initWithString_ = objc.registerName("initWithString:"); - -enum NSURLSessionWebSocketMessageType { - NSURLSessionWebSocketMessageTypeData(0), - NSURLSessionWebSocketMessageTypeString(1); - - final int value; - const NSURLSessionWebSocketMessageType(this.value); - - static NSURLSessionWebSocketMessageType fromValue(int value) => - switch (value) { - 0 => NSURLSessionWebSocketMessageTypeData, - 1 => NSURLSessionWebSocketMessageTypeString, - _ => throw ArgumentError( - 'Unknown value for NSURLSessionWebSocketMessageType: $value', - ), - }; -} - -late final _sel_type = objc.registerName("type"); -final _objc_msgSend_1qouven = objc.msgSendPointer +late final _sel_closeCode = objc.registerName("closeCode"); +final _objc_msgSend_1rhk8uh = objc.msgSendPointer .cast< ffi.NativeFunction< NSInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - int Function(ffi.Pointer, ffi.Pointer) + int Function( + ffi.Pointer, + ffi.Pointer, + ) >(); -late final _sel_data = objc.registerName("data"); -late final _sel_string = objc.registerName("string"); +late final _sel_closeReason = objc.registerName("closeReason"); -/// The client can create a WebSocket message object that will be passed to the send calls -/// and will be delivered from the receive calls. The message can be initialized with data or string. -/// If initialized with data, the string property will be nil and vice versa. -class NSURLSessionWebSocketMessage extends objc.NSObject { - NSURLSessionWebSocketMessage._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +/// A WebSocket task can be created with a ws or wss url. A client can also provide +/// a list of protocols it wishes to advertise during the WebSocket handshake phase. +/// Once the handshake is successfully completed the client will be notified through an optional delegate. +/// All reads and writes enqueued before the completion of the handshake will be queued up and +/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle +/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide +/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to +/// outgoing HTTP handshake requests. +extension type NSURLSessionWebSocketTask._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLSessionTask { + /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + NSURLSessionWebSocketTask.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage', + 'NSURLSessionWebSocketTask', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); + assert(isA(object$)); } - /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. - NSURLSessionWebSocketMessage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. - NSURLSessionWebSocketMessage.castFromPointer( - ffi.Pointer other, { + /// Constructs a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + NSURLSessionWebSocketTask.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLSessionWebSocketMessage, - ); - } - - /// Create a message with data type - NSURLSessionWebSocketMessage initWithData(objc.NSData data) { + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.initWithData:', + 'NSURLSessionWebSocketTask', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithData_, - data.ref.pointer, + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSessionWebSocketTask, + ); + + /// alloc + static NSURLSessionWebSocketTask alloc() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionWebSocketTask, + _sel_alloc, + ); + return NSURLSessionWebSocketTask.fromPointer( + $ret, + retain: false, + release: true, ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, + } + + /// allocWithZone: + static NSURLSessionWebSocketTask allocWithZone( + ffi.Pointer zone, + ) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURLSessionWebSocketTask, + _sel_allocWithZone_, + zone, + ); + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: false, release: true, ); } - /// Create a message with string type - NSURLSessionWebSocketMessage initWithString(objc.NSString string) { - objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.initWithString:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithString_, - string.ref.pointer, + /// new + static NSURLSessionWebSocketTask new$() { + final $ret = _objc_msgSend_151sglz( + _class_NSURLSessionWebSocketTask, + _sel_new, ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: false, release: true, ); } - /// type - NSURLSessionWebSocketMessageType get type { + /// Returns a new instance of NSURLSessionWebSocketTask constructed with the default `new` method. + NSURLSessionWebSocketTask() : this.as(new$().object$); +} + +extension NSURLSessionWebSocketTask$Methods on NSURLSessionWebSocketTask { + /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. + /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. + void cancelWithCloseCode(DartNSInteger closeCode, {objc.NSData? reason}) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.type', + 'NSURLSessionWebSocketTask.cancelWithCloseCode:reason:', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1qouven(this.ref.pointer, _sel_type); - return NSURLSessionWebSocketMessageType.fromValue(_ret); + _objc_msgSend_tqzk0b( + object$.ref.pointer, + _sel_cancelWithCloseCode_reason_, + closeCode, + reason?.ref.pointer ?? ffi.nullptr, + ); } - /// data - objc.NSData? get data { + /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid + DartNSInteger get closeCode { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.data', + 'NSURLSessionWebSocketTask.closeCode', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_data); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); + return _objc_msgSend_1rhk8uh(object$.ref.pointer, _sel_closeCode); } - /// string - objc.NSString? get string { + /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running + objc.NSData? get closeReason { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.string', + 'NSURLSessionWebSocketTask.closeReason', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_string); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_closeReason); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSData.fromPointer($ret, retain: true, release: true); } /// init - NSURLSessionWebSocketMessage init() { + NSURLSessionWebSocketTask init() { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketMessage.init', + 'NSURLSessionWebSocketTask.init', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), _sel_init, ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: false, release: true, ); } - /// new - static NSURLSessionWebSocketMessage new$() { - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionWebSocketMessage, - _sel_new, - ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: false, - release: true, + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + DartNSInteger get maximumMessageSize { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.maximumMessageSize', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); + return _objc_msgSend_1hz7y9r(object$.ref.pointer, _sel_maximumMessageSize); } - /// allocWithZone: - static NSURLSessionWebSocketMessage allocWithZone( - ffi.Pointer zone, + /// Reads a WebSocket message once all the frames of the message are available. + /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out + /// and all outstanding work will also fail resulting in the end of the task. + void receiveMessageWithCompletionHandler( + objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + > + completionHandler, ) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSessionWebSocketMessage, - _sel_allocWithZone_, - zone, + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.receiveMessageWithCompletionHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: false, - release: true, + _objc_msgSend_f167m6( + object$.ref.pointer, + _sel_receiveMessageWithCompletionHandler_, + completionHandler.ref.pointer, ); } - /// alloc - static NSURLSessionWebSocketMessage alloc() { - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionWebSocketMessage, - _sel_alloc, + /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. + /// Note that invocation of the completion handler does not + /// guarantee that the remote side has received all the bytes, only + /// that they have been written to the kernel. + void sendMessage( + NSURLSessionWebSocketMessage message, { + required objc.ObjCBlock completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.sendMessage:completionHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: false, - release: true, + _objc_msgSend_o762yo( + object$.ref.pointer, + _sel_sendMessage_completionHandler_, + message.ref.pointer, + completionHandler.ref.pointer, ); } - /// self - NSURLSessionWebSocketMessage self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: true, - release: true, + /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client + /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving + /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. + /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. + void sendPingWithPongReceiveHandler( + objc.ObjCBlock pongReceiveHandler, + ) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.sendPingWithPongReceiveHandler:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - } - - /// retain - NSURLSessionWebSocketMessage retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: true, - release: true, + _objc_msgSend_f167m6( + object$.ref.pointer, + _sel_sendPingWithPongReceiveHandler_, + pongReceiveHandler.ref.pointer, ); } - /// autorelease - NSURLSessionWebSocketMessage autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSessionWebSocketMessage.castFromPointer( - _ret, - retain: true, - release: true, + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + set maximumMessageSize(DartNSInteger value) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketTask.setMaximumMessageSize:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + _objc_msgSend_4sp4xj( + object$.ref.pointer, + _sel_setMaximumMessageSize_, + value, ); - } - - /// Returns a new instance of NSURLSessionWebSocketMessage constructed with the default `new` method. - factory NSURLSessionWebSocketMessage() => new$(); -} - -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSError_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); } } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSError_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSError_blockingTrampoline) - ..keepIsolateAlive = false; +late final _sel_webSocketTaskWithURL_ = objc.registerName( + "webSocketTaskWithURL:", +); +late final _sel_webSocketTaskWithURL_protocols_ = objc.registerName( + "webSocketTaskWithURL:protocols:", +); +late final _sel_webSocketTaskWithRequest_ = objc.registerName( + "webSocketTaskWithRequest:", +); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSError { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, - }) => objc.ObjCBlock( - pointer, - retain: retain, - release: release, - ); + }) => + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + >(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction arg0)> + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > > ptr, - ) => objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true, - ); + ) => + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + >( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -68772,22 +67998,38 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock fromFunction( - void Function(objc.NSError?) fn, { + static objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + fromFunction( + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { bool keepIsolateAlive = true, - }) => objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_closureCallable, - (ffi.Pointer arg0) => fn( - arg0.address == 0 - ? null - : objc.NSError.castFromPointer(arg0, retain: true, release: true), - ), - keepIsolateAlive, - ), - retain: false, - release: true, - ); + }) => + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + >( + objc.newClosureBlock( + _closureCallable, + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + arg0.address == 0 + ? null + : objc.NSData.fromPointer(arg0, retain: true, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: true, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: true, release: true), + ), + keepIsolateAlive, + ), + retain: false, + release: true, + ); /// Creates a listener block from a Dart function. /// @@ -68798,26 +68040,37 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock listener( - void Function(objc.NSError?) fn, { + static objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + listener( + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _listenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_xtuoz7(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); + return objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + >(wrapper, retain: false, release: true); } /// Creates a blocking block from a Dart function. @@ -68830,216 +68083,313 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// until it is garbage collected by both Dart and ObjC. If the owner isolate /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock blocking( - void Function(objc.NSError?) fn, { + static objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + blocking( + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_blockingListenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingListenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_xtuoz7( + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( raw, rawListener, objc.objCContext, ); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true, - ); + return objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + >(wrapper, retain: false, release: true); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSError? arg0) => ref.pointer.ref.invoke + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -late final _sel_sendMessage_completionHandler_ = objc.registerName( - "sendMessage:completionHandler:", +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError$CallExtension + on + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > { + void call(objc.NSData? arg0, NSURLResponse? arg1, objc.NSError? arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()( + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr, + ); +} + +late final _sel_dataTaskWithRequest_completionHandler_ = objc.registerName( + "dataTaskWithRequest:completionHandler:", ); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target +final _objc_msgSend_r0bo0s = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< - void Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingTrampoline, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( + >(); +late final _sel_dataTaskWithURL_completionHandler_ = objc.registerName( + "dataTaskWithURL:completionHandler:", +); +late final _sel_uploadTaskWithRequest_fromFile_completionHandler_ = objc + .registerName("uploadTaskWithRequest:fromFile:completionHandler:"); +final _objc_msgSend_2wiv66 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingTrampoline, + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - ..keepIsolateAlive = false; + >(); +late final _sel_uploadTaskWithRequest_fromData_completionHandler_ = objc + .registerName("uploadTaskWithRequest:fromData:completionHandler:"); +late final _sel_uploadTaskWithResumeData_completionHandler_ = objc.registerName( + "uploadTaskWithResumeData:completionHandler:", +); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) >(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -69048,26 +68398,24 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > > ptr, ) => objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -69081,35 +68429,31 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > fromFunction( - void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0.address == 0 ? null - : NSURLSessionWebSocketMessage.castFromPointer( - arg0, - retain: true, - release: true, - ), + : objc.NSURL.fromPointer(arg0, retain: true, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer( - arg1, - retain: true, - release: true, - ), + : NSURLResponse.fromPointer(arg1, retain: true, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: true, release: true), ), keepIsolateAlive, ), @@ -69124,42 +68468,38 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// but only supports void functions, and is not run synchronously. See /// NativeCallable.listener for more details. /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) - > - listener( - void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage.castFromPointer( - arg0, - retain: false, - release: true, - ), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer( - arg1, - retain: false, - release: true, - ), - ), + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) + > + listener( + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + arg0.address == 0 + ? null + : objc.NSURL.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), + ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_r8gdi7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) >(wrapper, retain: false, release: true); } @@ -69174,59 +68514,51 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > blocking( - void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn, { + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage.castFromPointer( - arg0, - retain: false, - release: true, - ), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer( - arg1, - retain: false, - release: true, - ), - ), + _blockingCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + arg0.address == 0 + ? null + : objc.NSURL.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), + ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage.castFromPointer( - arg0, - retain: false, - release: true, - ), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer( - arg1, - retain: false, - release: true, - ), - ), + _blockingListenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => fn( + arg0.address == 0 + ? null + : objc.NSURL.fromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.fromPointer(arg1, retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.fromPointer(arg2, retain: false, release: true), + ), keepIsolateAlive, ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_r8gdi7( raw, rawListener, objc.objCContext, @@ -69234,317 +68566,428 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_CallExtension +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError$CallExtension on objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > { - void call(NSURLSessionWebSocketMessage? arg0, objc.NSError? arg1) => + void call(objc.NSURL? arg0, NSURLResponse? arg1, objc.NSError? arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr, ); } -late final _sel_receiveMessageWithCompletionHandler_ = objc.registerName( - "receiveMessageWithCompletionHandler:", -); -late final _sel_sendPingWithPongReceiveHandler_ = objc.registerName( - "sendPingWithPongReceiveHandler:", -); - -/// The WebSocket close codes follow the close codes given in the RFC -sealed class NSURLSessionWebSocketCloseCode { - static const NSURLSessionWebSocketCloseCodeInvalid = 0; - static const NSURLSessionWebSocketCloseCodeNormalClosure = 1000; - static const NSURLSessionWebSocketCloseCodeGoingAway = 1001; - static const NSURLSessionWebSocketCloseCodeProtocolError = 1002; - static const NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; - static const NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; - static const NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; - static const NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; - static const NSURLSessionWebSocketCloseCodePolicyViolation = 1008; - static const NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; - static const NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010; - static const NSURLSessionWebSocketCloseCodeInternalServerError = 1011; - static const NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; -} - -late final _sel_cancelWithCloseCode_reason_ = objc.registerName( - "cancelWithCloseCode:reason:", +late final _sel_downloadTaskWithRequest_completionHandler_ = objc.registerName( + "downloadTaskWithRequest:completionHandler:", ); -final _objc_msgSend_tqzk0b = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ) - >(); -late final _sel_maximumMessageSize = objc.registerName("maximumMessageSize"); -late final _sel_setMaximumMessageSize_ = objc.registerName( - "setMaximumMessageSize:", +late final _sel_downloadTaskWithURL_completionHandler_ = objc.registerName( + "downloadTaskWithURL:completionHandler:", ); -late final _sel_closeCode = objc.registerName("closeCode"); -final _objc_msgSend_1rhk8uh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >(); -late final _sel_closeReason = objc.registerName("closeReason"); +late final _sel_downloadTaskWithResumeData_completionHandler_ = objc + .registerName("downloadTaskWithResumeData:completionHandler:"); -/// A WebSocket task can be created with a ws or wss url. A client can also provide -/// a list of protocols it wishes to advertise during the WebSocket handshake phase. -/// Once the handshake is successfully completed the client will be notified through an optional delegate. -/// All reads and writes enqueued before the completion of the handshake will be queued up and -/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle -/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide -/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to -/// outgoing HTTP handshake requests. -class NSURLSessionWebSocketTask extends NSURLSessionTask { - NSURLSessionWebSocketTask._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +/// NSURLSession convenience routines deliver results to +/// a completion handler block. These convenience routines +/// are not available to NSURLSessions that are configured +/// as background sessions. +/// +/// Task objects are always created in a suspended state and +/// must be sent the -resume message before they will execute. +extension NSURLSessionAsynchronousConvenience on NSURLSession { + /// data task convenience methods. These methods create tasks that + /// bypass the normal delegate calls for response and data delivery, + /// and provide a simple cancelable asynchronous interface to receiving + /// data. Errors will be returned in the NSURLErrorDomain, + /// see . The delegate, if any, will still be + /// called for authentication challenges. + NSURLSessionDataTask dataTaskWithRequest$1( + NSURLRequest request, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.dataTaskWithRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - } - - /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. - NSURLSessionWebSocketTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. - NSURLSessionWebSocketTask.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class_NSURLSessionWebSocketTask, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_dataTaskWithRequest_completionHandler_, + request.ref.pointer, + completionHandler.ref.pointer, ); + return NSURLSessionDataTask.fromPointer($ret, retain: true, release: true); } - /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. - /// Note that invocation of the completion handler does not - /// guarantee that the remote side has received all the bytes, only - /// that they have been written to the kernel. - void sendMessage( - NSURLSessionWebSocketMessage message, { - required objc.ObjCBlock completionHandler, + /// dataTaskWithURL:completionHandler: + NSURLSessionDataTask dataTaskWithURL$1( + objc.NSURL url, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + completionHandler, }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.sendMessage:completionHandler:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.dataTaskWithURL:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_o762yo( - this.ref.pointer, - _sel_sendMessage_completionHandler_, - message.ref.pointer, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_dataTaskWithURL_completionHandler_, + url.ref.pointer, completionHandler.ref.pointer, ); + return NSURLSessionDataTask.fromPointer($ret, retain: true, release: true); } - /// Reads a WebSocket message once all the frames of the message are available. - /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out - /// and all outstanding work will also fail resulting in the end of the task. - void receiveMessageWithCompletionHandler( - objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?) + /// download task convenience methods. When a download successfully + /// completes, the NSURL will point to a file that must be read or + /// copied during the invocation of the completion routine. The file + /// will be removed automatically. + NSURLSessionDownloadTask downloadTaskWithRequest$1( + NSURLRequest request, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) > completionHandler, - ) { + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.receiveMessageWithCompletionHandler:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.downloadTaskWithRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_f167m6( - this.ref.pointer, - _sel_receiveMessageWithCompletionHandler_, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_downloadTaskWithRequest_completionHandler_, + request.ref.pointer, completionHandler.ref.pointer, ); + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: true, + release: true, + ); } - /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client - /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving - /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. - /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. - void sendPingWithPongReceiveHandler( - objc.ObjCBlock pongReceiveHandler, - ) { + /// downloadTaskWithResumeData:completionHandler: + NSURLSessionDownloadTask downloadTaskWithResumeData$1( + objc.NSData resumeData, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.sendPingWithPongReceiveHandler:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.downloadTaskWithResumeData:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_f167m6( - this.ref.pointer, - _sel_sendPingWithPongReceiveHandler_, - pongReceiveHandler.ref.pointer, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_downloadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer, + ); + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: true, + release: true, ); } - /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. - /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. - void cancelWithCloseCode(DartNSInteger closeCode, {objc.NSData? reason}) { + /// downloadTaskWithURL:completionHandler: + NSURLSessionDownloadTask downloadTaskWithURL$1( + objc.NSURL url, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.cancelWithCloseCode:reason:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.downloadTaskWithURL:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_tqzk0b( - this.ref.pointer, - _sel_cancelWithCloseCode_reason_, - closeCode, - reason?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_downloadTaskWithURL_completionHandler_, + url.ref.pointer, + completionHandler.ref.pointer, ); - } - - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - DartNSInteger get maximumMessageSize { - objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.maximumMessageSize', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: true, + release: true, ); - return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_maximumMessageSize); } - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - set maximumMessageSize(DartNSInteger value) { + /// uploadTaskWithRequest:fromData:completionHandler: + NSURLSessionUploadTask uploadTaskWithRequest$2( + NSURLRequest request, { + objc.NSData? fromData, + required objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.setMaximumMessageSize:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSURLSession.uploadTaskWithRequest:fromData:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); - _objc_msgSend_4sp4xj(this.ref.pointer, _sel_setMaximumMessageSize_, value); - } - - /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid - DartNSInteger get closeCode { - objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.closeCode', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + final $ret = _objc_msgSend_2wiv66( + object$.ref.pointer, + _sel_uploadTaskWithRequest_fromData_completionHandler_, + request.ref.pointer, + fromData?.ref.pointer ?? ffi.nullptr, + completionHandler.ref.pointer, ); - return _objc_msgSend_1rhk8uh(this.ref.pointer, _sel_closeCode); - } - - /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running - objc.NSData? get closeReason { - objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.closeReason', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + return NSURLSessionUploadTask.fromPointer( + $ret, + retain: true, + release: true, ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_closeReason); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); } - /// init - NSURLSessionWebSocketTask init() { + /// upload convenience method. + NSURLSessionUploadTask uploadTaskWithRequest$3( + NSURLRequest request, { + required objc.NSURL fromFile, + required objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.init', + 'NSURLSession.uploadTaskWithRequest:fromFile:completionHandler:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + final $ret = _objc_msgSend_2wiv66( + object$.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_completionHandler_, + request.ref.pointer, + fromFile.ref.pointer, + completionHandler.ref.pointer, ); - return NSURLSessionWebSocketTask.castFromPointer( - _ret, - retain: false, + return NSURLSessionUploadTask.fromPointer( + $ret, + retain: true, release: true, ); } - /// new - static NSURLSessionWebSocketTask new$() { + /// Creates a URLSessionUploadTask from a resume data blob. If resuming from an upload + /// file, the file must still exist and be unmodified. + /// + /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. + /// - Parameter completionHandler: The completion handler to call when the load request is complete. + /// - Returns: A new session upload task, or nil if the resumeData is invalid. + NSURLSessionUploadTask uploadTaskWithResumeData$1( + objc.NSData resumeData, { + required objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?) + > + completionHandler, + }) { objc.checkOsVersionInternal( - 'NSURLSessionWebSocketTask.new', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSession.uploadTaskWithResumeData:completionHandler:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), ); - final _ret = _objc_msgSend_151sglz( - _class_NSURLSessionWebSocketTask, - _sel_new, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_uploadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer, ); - return NSURLSessionWebSocketTask.castFromPointer( - _ret, - retain: false, + return NSURLSessionUploadTask.fromPointer( + $ret, + retain: true, release: true, ); } - - /// Returns a new instance of NSURLSessionWebSocketTask constructed with the default `new` method. - factory NSURLSessionWebSocketTask() => new$(); } -late final _sel_webSocketTaskWithURL_ = objc.registerName( - "webSocketTaskWithURL:", -); -late final _sel_webSocketTaskWithURL_protocols_ = objc.registerName( - "webSocketTaskWithURL:protocols:", -); -late final _sel_webSocketTaskWithRequest_ = objc.registerName( - "webSocketTaskWithRequest:", -); - /// NSURLSession is a replacement API for NSURLConnection. It provides /// options that affect the policy of, and various aspects of the /// mechanism by which NSURLRequest objects are retrieved from the @@ -69604,49 +69047,59 @@ late final _sel_webSocketTaskWithRequest_ = objc.registerName( /// WebSocket. The task will perform the HTTP handshake to upgrade the connection /// and once the WebSocket handshake is successful, the client can read and write /// messages that will be framed using the WebSocket protocol by the framework. -class NSURLSession extends objc.NSObject { - NSURLSession._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +extension type NSURLSession._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSURLSession] that points to the same underlying object as [other]. + NSURLSession.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSURLSession', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); + assert(isA(object$)); } - /// Constructs a [NSURLSession] that points to the same underlying object as [other]. - NSURLSession.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLSession] that wraps the given raw object pointer. - NSURLSession.castFromPointer( - ffi.Pointer other, { + NSURLSession.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSURLSession', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + assert(isA(object$)); + } /// Returns whether [obj] is an instance of [NSURLSession]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSURLSession, + ); + + /// alloc + static NSURLSession alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_alloc); + return NSURLSession.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLSession allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( _class_NSURLSession, + _sel_allocWithZone_, + zone, ); + return NSURLSession.fromPointer($ret, retain: false, release: true); } - /// The shared session uses the currently set global NSURLCache, - /// NSHTTPCookieStorage and NSURLCredentialStorage objects. - static NSURLSession getSharedSession() { - objc.checkOsVersionInternal( - 'NSURLSession.sharedSession', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_sharedSession); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); + /// new + static NSURLSession new$() { + final $ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_new); + return NSURLSession.fromPointer($ret, retain: false, release: true); } /// Customization of NSURLSession occurs during creation of a new session. @@ -69662,12 +69115,12 @@ class NSURLSession extends objc.NSObject { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSURLSession, _sel_sessionWithConfiguration_, configuration.ref.pointer, ); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); + return NSURLSession.fromPointer($ret, retain: true, release: true); } /// sessionWithConfiguration:delegate:delegateQueue: @@ -69677,29 +69130,80 @@ class NSURLSession extends objc.NSObject { NSOperationQueue? delegateQueue, }) { objc.checkOsVersionInternal( - 'NSURLSession.sessionWithConfiguration:delegate:delegateQueue:', + 'NSURLSession.sessionWithConfiguration:delegate:delegateQueue:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_11spmsz( + _class_NSURLSession, + _sel_sessionWithConfiguration_delegate_delegateQueue_, + configuration.ref.pointer, + delegate?.ref.pointer ?? ffi.nullptr, + delegateQueue?.ref.pointer ?? ffi.nullptr, + ); + return NSURLSession.fromPointer($ret, retain: true, release: true); + } + + /// The shared session uses the currently set global NSURLCache, + /// NSHTTPCookieStorage and NSURLCredentialStorage objects. + static NSURLSession getSharedSession() { + objc.checkOsVersionInternal( + 'NSURLSession.sharedSession', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_sharedSession); + return NSURLSession.fromPointer($ret, retain: true, release: true); + } + + /// Returns a new instance of NSURLSession constructed with the default `new` method. + NSURLSession() : this.as(new$().object$); +} + +extension NSURLSession$Methods on NSURLSession { + /// configuration + NSURLSessionConfiguration get configuration { + objc.checkOsVersionInternal( + 'NSURLSession.configuration', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_configuration); + return NSURLSessionConfiguration.fromPointer( + $ret, + retain: true, + release: true, + ); + } + + /// Creates a data task with the given request. The request may have a body stream. + NSURLSessionDataTask dataTaskWithRequest(NSURLRequest request) { + objc.checkOsVersionInternal( + 'NSURLSession.dataTaskWithRequest:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_11spmsz( - _class_NSURLSession, - _sel_sessionWithConfiguration_delegate_delegateQueue_, - configuration.ref.pointer, - delegate?.ref.pointer ?? ffi.nullptr, - delegateQueue?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_dataTaskWithRequest_, + request.ref.pointer, ); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); + return NSURLSessionDataTask.fromPointer($ret, retain: true, release: true); } - /// delegateQueue - NSOperationQueue get delegateQueue { + /// Creates a data task to retrieve the contents of the given URL. + NSURLSessionDataTask dataTaskWithURL(objc.NSURL url) { objc.checkOsVersionInternal( - 'NSURLSession.delegateQueue', + 'NSURLSession.dataTaskWithURL:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegateQueue); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_dataTaskWithURL_, + url.ref.pointer, + ); + return NSURLSessionDataTask.fromPointer($ret, retain: true, release: true); } /// delegate @@ -69709,60 +69213,77 @@ class NSURLSession extends objc.NSObject { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegate); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_delegate); + return $ret.address == 0 ? null - : NSURLSessionDelegate.castFromPointer( - _ret, - retain: true, - release: true, - ); + : NSURLSessionDelegate.fromPointer($ret, retain: true, release: true); } - /// configuration - NSURLSessionConfiguration get configuration { + /// delegateQueue + NSOperationQueue get delegateQueue { objc.checkOsVersionInternal( - 'NSURLSession.configuration', + 'NSURLSession.delegateQueue', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_delegateQueue); + return NSOperationQueue.fromPointer($ret, retain: true, release: true); + } + + /// Creates a download task with the given request. + NSURLSessionDownloadTask downloadTaskWithRequest(NSURLRequest request) { + objc.checkOsVersionInternal( + 'NSURLSession.downloadTaskWithRequest:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_configuration); - return NSURLSessionConfiguration.castFromPointer( - _ret, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_downloadTaskWithRequest_, + request.ref.pointer, + ); + return NSURLSessionDownloadTask.fromPointer( + $ret, retain: true, release: true, ); } - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - objc.NSString? get sessionDescription { + /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. + NSURLSessionDownloadTask downloadTaskWithResumeData(objc.NSData resumeData) { objc.checkOsVersionInternal( - 'NSURLSession.sessionDescription', + 'NSURLSession.downloadTaskWithResumeData:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_sessionDescription, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_downloadTaskWithResumeData_, + resumeData.ref.pointer, + ); + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: true, + release: true, ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - set sessionDescription(objc.NSString? value) { + /// Creates a download task to download the contents of the given URL. + NSURLSessionDownloadTask downloadTaskWithURL(objc.NSURL url) { objc.checkOsVersionInternal( - 'NSURLSession.setSessionDescription:', + 'NSURLSession.downloadTaskWithURL:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setSessionDescription_, - value?.ref.pointer ?? ffi.nullptr, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_downloadTaskWithURL_, + url.ref.pointer, + ); + return NSURLSessionDownloadTask.fromPointer( + $ret, + retain: true, + release: true, ); } @@ -69783,50 +69304,37 @@ class NSURLSession extends objc.NSObject { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_finishTasksAndInvalidate); - } - - /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues - /// -cancel to all outstanding tasks for this session. Note task - /// cancellation is subject to the state of the task, and some tasks may - /// have already have completed at the time they are sent -cancel. - void invalidateAndCancel() { - objc.checkOsVersionInternal( - 'NSURLSession.invalidateAndCancel', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_invalidateAndCancel); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_finishTasksAndInvalidate); } - /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. - void resetWithCompletionHandler( + /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. + void flushWithCompletionHandler( objc.ObjCBlock completionHandler, ) { objc.checkOsVersionInternal( - 'NSURLSession.resetWithCompletionHandler:', + 'NSURLSession.flushWithCompletionHandler:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); _objc_msgSend_f167m6( - this.ref.pointer, - _sel_resetWithCompletionHandler_, + object$.ref.pointer, + _sel_flushWithCompletionHandler_, completionHandler.ref.pointer, ); } - /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. - void flushWithCompletionHandler( - objc.ObjCBlock completionHandler, + /// invokes completionHandler with all outstanding tasks. + void getAllTasksWithCompletionHandler( + objc.ObjCBlock completionHandler, ) { objc.checkOsVersionInternal( - 'NSURLSession.flushWithCompletionHandler:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSession.getAllTasksWithCompletionHandler:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); _objc_msgSend_f167m6( - this.ref.pointer, - _sel_flushWithCompletionHandler_, + object$.ref.pointer, + _sel_getAllTasksWithCompletionHandler_, completionHandler.ref.pointer, ); } @@ -69842,107 +69350,171 @@ class NSURLSession extends objc.NSObject { macOS: (false, (10, 9, 0)), ); _objc_msgSend_f167m6( - this.ref.pointer, + object$.ref.pointer, _sel_getTasksWithCompletionHandler_, completionHandler.ref.pointer, ); } - /// invokes completionHandler with all outstanding tasks. - void getAllTasksWithCompletionHandler( - objc.ObjCBlock completionHandler, + /// init + NSURLSession init() { + objc.checkOsVersionInternal( + 'NSURLSession.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSURLSession.fromPointer($ret, retain: false, release: true); + } + + /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues + /// -cancel to all outstanding tasks for this session. Note task + /// cancellation is subject to the state of the task, and some tasks may + /// have already have completed at the time they are sent -cancel. + void invalidateAndCancel() { + objc.checkOsVersionInternal( + 'NSURLSession.invalidateAndCancel', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_invalidateAndCancel); + } + + /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. + void resetWithCompletionHandler( + objc.ObjCBlock completionHandler, ) { objc.checkOsVersionInternal( - 'NSURLSession.getAllTasksWithCompletionHandler:', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), + 'NSURLSession.resetWithCompletionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), ); _objc_msgSend_f167m6( - this.ref.pointer, - _sel_getAllTasksWithCompletionHandler_, + object$.ref.pointer, + _sel_resetWithCompletionHandler_, completionHandler.ref.pointer, ); } - /// Creates a data task with the given request. The request may have a body stream. - NSURLSessionDataTask dataTaskWithRequest(NSURLRequest request) { + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + objc.NSString? get sessionDescription { objc.checkOsVersionInternal( - 'NSURLSession.dataTaskWithRequest:', + 'NSURLSession.sessionDescription', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_dataTaskWithRequest_, - request.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_sessionDescription, + ); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + set sessionDescription(objc.NSString? value) { + objc.checkOsVersionInternal( + 'NSURLSession.setSessionDescription:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setSessionDescription_, + value?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Creates a bidirectional stream task to a given host and port. + NSURLSessionStreamTask streamTaskWithHostName( + objc.NSString hostname, { + required DartNSInteger port, + }) { + objc.checkOsVersionInternal( + 'NSURLSession.streamTaskWithHostName:port:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), + ); + final $ret = _objc_msgSend_9slupp( + object$.ref.pointer, + _sel_streamTaskWithHostName_port_, + hostname.ref.pointer, + port, ); - return NSURLSessionDataTask.castFromPointer( - _ret, + return NSURLSessionStreamTask.fromPointer( + $ret, retain: true, release: true, ); } - /// Creates a data task to retrieve the contents of the given URL. - NSURLSessionDataTask dataTaskWithURL(objc.NSURL url) { + /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. + /// The NSNetService will be resolved before any IO completes. + NSURLSessionStreamTask streamTaskWithNetService(NSNetService service) { objc.checkOsVersionInternal( - 'NSURLSession.dataTaskWithURL:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSession.streamTaskWithNetService:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_dataTaskWithURL_, - url.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_streamTaskWithNetService_, + service.ref.pointer, ); - return NSURLSessionDataTask.castFromPointer( - _ret, + return NSURLSessionStreamTask.fromPointer( + $ret, retain: true, release: true, ); } - /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL + /// Creates an upload task with the given request. The body of the request is provided from the bodyData. NSURLSessionUploadTask uploadTaskWithRequest( NSURLRequest request, { - required objc.NSURL fromFile, + required objc.NSData fromData, }) { objc.checkOsVersionInternal( - 'NSURLSession.uploadTaskWithRequest:fromFile:', + 'NSURLSession.uploadTaskWithRequest:fromData:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_15qeuct( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromFile_, + final $ret = _objc_msgSend_15qeuct( + object$.ref.pointer, + _sel_uploadTaskWithRequest_fromData_, request.ref.pointer, - fromFile.ref.pointer, + fromData.ref.pointer, ); - return NSURLSessionUploadTask.castFromPointer( - _ret, + return NSURLSessionUploadTask.fromPointer( + $ret, retain: true, release: true, ); } - /// Creates an upload task with the given request. The body of the request is provided from the bodyData. + /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL NSURLSessionUploadTask uploadTaskWithRequest$1( NSURLRequest request, { - required objc.NSData fromData, + required objc.NSURL fromFile, }) { objc.checkOsVersionInternal( - 'NSURLSession.uploadTaskWithRequest:fromData:', + 'NSURLSession.uploadTaskWithRequest:fromFile:', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_15qeuct( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromData_, + final $ret = _objc_msgSend_15qeuct( + object$.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_, request.ref.pointer, - fromData.ref.pointer, + fromFile.ref.pointer, ); - return NSURLSessionUploadTask.castFromPointer( - _ret, + return NSURLSessionUploadTask.fromPointer( + $ret, retain: true, release: true, ); @@ -69962,13 +69534,13 @@ class NSURLSession extends objc.NSObject { iOS: (false, (17, 0, 0)), macOS: (false, (14, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_uploadTaskWithResumeData_, resumeData.ref.pointer, ); - return NSURLSessionUploadTask.castFromPointer( - _ret, + return NSURLSessionUploadTask.fromPointer( + $ret, retain: true, release: true, ); @@ -69981,113 +69553,34 @@ class NSURLSession extends objc.NSObject { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_uploadTaskWithStreamedRequest_, request.ref.pointer, ); - return NSURLSessionUploadTask.castFromPointer( - _ret, + return NSURLSessionUploadTask.fromPointer( + $ret, retain: true, release: true, ); } - /// Creates a download task with the given request. - NSURLSessionDownloadTask downloadTaskWithRequest(NSURLRequest request) { + /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. + /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol + /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. + NSURLSessionWebSocketTask webSocketTaskWithRequest(NSURLRequest request) { objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithRequest:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), + 'NSURLSession.webSocketTaskWithRequest:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_downloadTaskWithRequest_, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_webSocketTaskWithRequest_, request.ref.pointer, ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// Creates a download task to download the contents of the given URL. - NSURLSessionDownloadTask downloadTaskWithURL(objc.NSURL url) { - objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithURL:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_downloadTaskWithURL_, - url.ref.pointer, - ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. - NSURLSessionDownloadTask downloadTaskWithResumeData(objc.NSData resumeData) { - objc.checkOsVersionInternal( - 'NSURLSession.downloadTaskWithResumeData:', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_downloadTaskWithResumeData_, - resumeData.ref.pointer, - ); - return NSURLSessionDownloadTask.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// Creates a bidirectional stream task to a given host and port. - NSURLSessionStreamTask streamTaskWithHostName( - objc.NSString hostname, { - required DartNSInteger port, - }) { - objc.checkOsVersionInternal( - 'NSURLSession.streamTaskWithHostName:port:', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), - ); - final _ret = _objc_msgSend_9slupp( - this.ref.pointer, - _sel_streamTaskWithHostName_port_, - hostname.ref.pointer, - port, - ); - return NSURLSessionStreamTask.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. - /// The NSNetService will be resolved before any IO completes. - NSURLSessionStreamTask streamTaskWithNetService(NSNetService service) { - objc.checkOsVersionInternal( - 'NSURLSession.streamTaskWithNetService:', - iOS: (false, (9, 0, 0)), - macOS: (false, (10, 11, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_streamTaskWithNetService_, - service.ref.pointer, - ); - return NSURLSessionStreamTask.castFromPointer( - _ret, + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: true, release: true, ); @@ -70100,13 +69593,13 @@ class NSURLSession extends objc.NSObject { iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_webSocketTaskWithURL_, url.ref.pointer, ); - return NSURLSessionWebSocketTask.castFromPointer( - _ret, + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: true, release: true, ); @@ -70124,96 +69617,18 @@ class NSURLSession extends objc.NSObject { iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_15qeuct( - this.ref.pointer, + final $ret = _objc_msgSend_15qeuct( + object$.ref.pointer, _sel_webSocketTaskWithURL_protocols_, url.ref.pointer, protocols.ref.pointer, ); - return NSURLSessionWebSocketTask.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. - /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol - /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. - NSURLSessionWebSocketTask webSocketTaskWithRequest(NSURLRequest request) { - objc.checkOsVersionInternal( - 'NSURLSession.webSocketTaskWithRequest:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_webSocketTaskWithRequest_, - request.ref.pointer, - ); - return NSURLSessionWebSocketTask.castFromPointer( - _ret, + return NSURLSessionWebSocketTask.fromPointer( + $ret, retain: true, release: true, ); } - - /// init - NSURLSession init() { - objc.checkOsVersionInternal( - 'NSURLSession.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLSession new$() { - final _ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_new); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSURLSession allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSURLSession, - _sel_allocWithZone_, - zone, - ); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSURLSession alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSURLSession, _sel_alloc); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSURLSession self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSURLSession retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSURLSession autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } - - /// Returns a new instance of NSURLSession constructed with the default `new` method. - factory NSURLSession() => new$(); } /// Disposition options for various delegate messages @@ -70305,114 +69720,24 @@ final _objc_msgSend_e3qsqz = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( - ffi.Pointer block, - int arg0, -) => block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger) - >(_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( - ffi.Pointer block, - int arg0, -) => (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger) - >(_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( - ffi.Pointer block, - int arg0, -) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger) -> -_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(int))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -70430,10 +69755,7 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer> ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -70451,7 +69773,7 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, + _closureCallable, (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), keepIsolateAlive, ), @@ -70473,9 +69795,7 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), keepIsolateAlive, ); @@ -70503,16 +69823,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0)), keepIsolateAlive, ); @@ -70529,10 +69845,93 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(int))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ) => block.ref.target + .cast>() + .asFunction()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ) => (objc.getBlockClosure(block) as void Function(int))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension +extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition$CallExtension on objc.ObjCBlock { void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke @@ -70552,142 +69951,35 @@ extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); -void -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) => block.ref.target +final _objc_msgSend_m7tls4 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) - > - >() - .asFunction)>()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable = - ffi.NativeCallable< ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingTrampoline, + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -70706,15 +69998,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSU fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) + ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -70733,12 +70022,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSU bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( + _closureCallable, + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionDelayedRequestDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLRequest.castFromPointer(arg1, retain: true, release: true), + : NSURLRequest.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -70760,14 +70049,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _listenerCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionDelayedRequestDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLRequest.castFromPointer(arg1, retain: false, release: true), + : NSURLRequest.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -70795,26 +70082,22 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _blockingCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionDelayedRequestDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLRequest.castFromPointer(arg1, retain: false, release: true), + : NSURLRequest.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_blockingListenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionDelayedRequestDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLRequest.castFromPointer(arg1, retain: false, release: true), + : NSURLRequest.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -70831,10 +70114,132 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSU release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSInteger arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction)>()( + arg0, + arg1, + ); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension +extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest$CallExtension on objc.ObjCBlock { void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => ref.pointer.ref.invoke @@ -70843,7 +70248,7 @@ extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_C ffi.Void Function( ffi.Pointer block, NSInteger arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -70851,210 +70256,11 @@ extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_C void Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); } -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingTrampoline, - ) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { /// Returns a block that wraps the given raw block pointer. @@ -71067,7 +70273,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -71101,9 +70307,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -71119,10 +70325,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -71165,23 +70368,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: true, - release: true, - ), - NSURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: true, release: true), + NSURLResponse.fromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.fromPointer( arg4, retain: true, release: true, @@ -71223,25 +70422,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.fromPointer( arg4, retain: false, release: true, @@ -71293,25 +70486,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.fromPointer( arg4, retain: false, release: true, @@ -71320,25 +70507,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.fromPointer( arg4, retain: false, release: true, @@ -71363,10 +70544,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -71390,9 +70754,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLRespo ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -71401,9 +70765,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLRespo void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -71419,30 +70783,51 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLRespo late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = objc.registerName( "URLSession:dataTask:didBecomeDownloadTask:", ); +final _objc_msgSend_r8gdi7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(); late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = objc .registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); final _objc_msgSend_xw7l5 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Long, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >(); late final _sel_statusCode = objc.registerName("statusCode"); @@ -71453,94 +70838,100 @@ late final _sel_localizedStringForStatusCode_ = objc.registerName( final _objc_msgSend_qugqlf = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Long, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, ) >(); /// NSHTTPURLResponse -class NSHTTPURLResponse extends NSURLResponse { - NSHTTPURLResponse._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - +extension type NSHTTPURLResponse._(objc.ObjCObject object$) + implements objc.ObjCObject, NSURLResponse { /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. - NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSHTTPURLResponse.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. - NSHTTPURLResponse.castFromPointer( - ffi.Pointer other, { + NSHTTPURLResponse.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSHTTPURLResponse, + ); + + /// alloc + static NSHTTPURLResponse alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_alloc); + return NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSHTTPURLResponse allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( _class_NSHTTPURLResponse, + _sel_allocWithZone_, + zone, ); + return NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); } /// ! - /// @method initWithURL:statusCode:HTTPVersion:headerFields: - /// @abstract initializer for NSHTTPURLResponse objects. - /// @param url the URL from which the response was generated. - /// @param statusCode an HTTP status code. - /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". - /// @param headerFields A dictionary representing the header keys and values of the server response. - /// @result the instance of the object, or NULL if an error occurred during initialization. - /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. - NSHTTPURLResponse? initWithURLAndStatusCode( - objc.NSURL url, { - required DartNSInteger statusCode, - objc.NSString? HTTPVersion, - objc.NSDictionary? headerFields, - }) { + /// @method localizedStringForStatusCode: + /// @abstract Convenience method which returns a localized string + /// corresponding to the status code for this response. + /// @param statusCode the status code to use to produce a localized string. + /// @result A localized string corresponding to the given status code. + static objc.NSString localizedStringForStatusCode(DartNSInteger statusCode) { objc.checkOsVersionInternal( - 'NSHTTPURLResponse.initWithURL:statusCode:HTTPVersion:headerFields:', - iOS: (false, (5, 0, 0)), - macOS: (false, (10, 7, 0)), + 'NSHTTPURLResponse.localizedStringForStatusCode:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_xw7l5( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_statusCode_HTTPVersion_headerFields_, - url.ref.pointer, + final $ret = _objc_msgSend_qugqlf( + _class_NSHTTPURLResponse, + _sel_localizedStringForStatusCode_, statusCode, - HTTPVersion?.ref.pointer ?? ffi.nullptr, - headerFields?.ref.pointer ?? ffi.nullptr, ); - return _ret.address == 0 - ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + return objc.NSString.fromPointer($ret, retain: true, release: true); } - /// ! - /// @abstract Returns the HTTP status code of the receiver. - /// @result The HTTP status code of the receiver. - DartNSInteger get statusCode { - objc.checkOsVersionInternal( - 'NSHTTPURLResponse.statusCode', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), + /// new + static NSHTTPURLResponse new$() { + final $ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_new); + return NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSHTTPURLResponse, + _sel_supportsSecureCoding, ); - return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_statusCode); } + /// Returns a new instance of NSHTTPURLResponse constructed with the default `new` method. + NSHTTPURLResponse() : this.as(new$().object$); +} + +extension NSHTTPURLResponse$Methods on NSHTTPURLResponse { /// ! /// @abstract Returns a dictionary containing all the HTTP header fields /// of the receiver. @@ -71556,55 +70947,37 @@ class NSHTTPURLResponse extends NSURLResponse { iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_allHeaderFields); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_allHeaderFields, + ); + return objc.NSDictionary.fromPointer($ret, retain: true, release: true); } - /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - objc.NSString? valueForHTTPHeaderField(objc.NSString field) { + /// init + NSHTTPURLResponse init() { objc.checkOsVersionInternal( - 'NSHTTPURLResponse.valueForHTTPHeaderField:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), + 'NSHTTPURLResponse.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_valueForHTTPHeaderField_, - field.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + return NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); } - /// ! - /// @method localizedStringForStatusCode: - /// @abstract Convenience method which returns a localized string - /// corresponding to the status code for this response. - /// @param statusCode the status code to use to produce a localized string. - /// @result A localized string corresponding to the given status code. - static objc.NSString localizedStringForStatusCode( - DartNSInteger statusCode$1, - ) { - objc.checkOsVersionInternal( - 'NSHTTPURLResponse.localizedStringForStatusCode:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 2, 0)), - ); - final _ret = _objc_msgSend_qugqlf( - _class_NSHTTPURLResponse, - _sel_localizedStringForStatusCode_, - statusCode$1, + /// initWithCoder: + NSHTTPURLResponse? initWithCoder(objc.NSCoder coder) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithCoder_, + coder.ref.pointer, ); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); + return $ret.address == 0 + ? null + : NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); } /// ! @@ -71627,297 +71000,88 @@ class NSHTTPURLResponse extends NSURLResponse { iOS: (false, (2, 0, 0)), macOS: (false, (10, 2, 0)), ); - final _ret = _objc_msgSend_l9ppnx( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_l9ppnx( + object$.ref.retainAndReturnPointer(), _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, URL.ref.pointer, MIMEType?.ref.pointer ?? ffi.nullptr, length, name?.ref.pointer ?? ffi.nullptr, ); - return NSHTTPURLResponse.castFromPointer( - _ret, - retain: false, - release: true, - ); + return NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); } - /// init - NSHTTPURLResponse init() { + /// ! + /// @method initWithURL:statusCode:HTTPVersion:headerFields: + /// @abstract initializer for NSHTTPURLResponse objects. + /// @param url the URL from which the response was generated. + /// @param statusCode an HTTP status code. + /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". + /// @param headerFields A dictionary representing the header keys and values of the server response. + /// @result the instance of the object, or NULL if an error occurred during initialization. + /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. + NSHTTPURLResponse? initWithURLAndStatusCode( + objc.NSURL url, { + required DartNSInteger statusCode, + objc.NSString? HTTPVersion, + objc.NSDictionary? headerFields, + }) { objc.checkOsVersionInternal( - 'NSHTTPURLResponse.init', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, - ); - return NSHTTPURLResponse.castFromPointer( - _ret, - retain: false, - release: true, - ); - } - - /// new - static NSHTTPURLResponse new$() { - final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_new); - return NSHTTPURLResponse.castFromPointer( - _ret, - retain: false, - release: true, - ); - } - - /// allocWithZone: - static NSHTTPURLResponse allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSHTTPURLResponse, - _sel_allocWithZone_, - zone, + 'NSHTTPURLResponse.initWithURL:statusCode:HTTPVersion:headerFields:', + iOS: (false, (5, 0, 0)), + macOS: (false, (10, 7, 0)), ); - return NSHTTPURLResponse.castFromPointer( - _ret, - retain: false, - release: true, + final $ret = _objc_msgSend_xw7l5( + object$.ref.retainAndReturnPointer(), + _sel_initWithURL_statusCode_HTTPVersion_headerFields_, + url.ref.pointer, + statusCode, + HTTPVersion?.ref.pointer ?? ffi.nullptr, + headerFields?.ref.pointer ?? ffi.nullptr, ); + return $ret.address == 0 + ? null + : NSHTTPURLResponse.fromPointer($ret, retain: false, release: true); } - /// alloc - static NSHTTPURLResponse alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSHTTPURLResponse, _sel_alloc); - return NSHTTPURLResponse.castFromPointer( - _ret, - retain: false, - release: true, + /// ! + /// @abstract Returns the HTTP status code of the receiver. + /// @result The HTTP status code of the receiver. + DartNSInteger get statusCode { + objc.checkOsVersionInternal( + 'NSHTTPURLResponse.statusCode', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 2, 0)), ); + return _objc_msgSend_1hz7y9r(object$.ref.pointer, _sel_statusCode); } - /// self - NSHTTPURLResponse self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSHTTPURLResponse retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSHTTPURLResponse autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSHTTPURLResponse, - _sel_supportsSecureCoding, + /// ! + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField(objc.NSString field) { + objc.checkOsVersionInternal( + 'NSHTTPURLResponse.valueForHTTPHeaderField:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), ); - } - - /// initWithCoder: - NSHTTPURLResponse? initWithCoder(objc.NSCoder coder) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, - coder.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_valueForHTTPHeaderField_, + field.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); - } - - /// Returns a new instance of NSHTTPURLResponse constructed with the default `new` method. - factory NSHTTPURLResponse() => new$(); -} - -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); + : objc.NSString.fromPointer($ret, retain: true, release: true); } } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { /// Returns a block that wraps the given raw block pointer. @@ -71929,7 +71093,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDownloadTask, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -71961,9 +71125,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -71977,10 +71141,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionDownloadTask, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -72020,21 +71181,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: true, - release: true, - ), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: true, release: true), + NSURLSessionDownloadTask.fromPointer( arg3, retain: true, release: true, @@ -72074,23 +71231,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg3, retain: false, release: true, @@ -72139,23 +71290,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg3, retain: false, release: true, @@ -72164,23 +71309,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg3, retain: false, release: true, @@ -72204,10 +71343,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -72229,9 +71534,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -72239,9 +71544,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -72255,187 +71560,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi late final _sel_URLSession_dataTask_didBecomeStreamTask_ = objc.registerName( "URLSession:dataTask:didBecomeStreamTask:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { @@ -72448,7 +71572,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionStreamTask, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -72480,9 +71604,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -72496,10 +71620,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask NSURLSessionStreamTask, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -72539,21 +71660,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: true, - release: true, - ), - NSURLSessionStreamTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: true, release: true), + NSURLSessionStreamTask.fromPointer( arg3, retain: true, release: true, @@ -72593,27 +71710,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionStreamTask.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionStreamTask.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -72658,52 +71765,32 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionStreamTask.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionStreamTask.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSURLSessionStreamTask.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionStreamTask.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -72723,10 +71810,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -72748,9 +72001,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -72758,9 +72011,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -72774,187 +72027,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi late final _sel_URLSession_dataTask_didReceiveData_ = objc.registerName( "URLSession:dataTask:didReceiveData:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { @@ -72967,7 +72039,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.NSData, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -72999,9 +72071,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -73015,10 +72087,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.NSData, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -73058,21 +72127,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: true, - release: true, - ), - objc.NSData.castFromPointer(arg3, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: true, release: true), + objc.NSData.fromPointer(arg3, retain: true, release: true), ), keepIsolateAlive, ), @@ -73108,23 +72173,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - objc.NSData.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + objc.NSData.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -73169,44 +72228,32 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - objc.NSData.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + objc.NSData.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - objc.NSData.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + objc.NSData.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -73226,10 +72273,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -73251,9 +72464,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_Cal ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -73261,9 +72474,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_Cal void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -73276,204 +72489,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_Cal late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { @@ -73487,7 +72502,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -73521,9 +72536,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -73539,10 +72554,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -73585,27 +72597,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: true, - release: true, - ), - NSCachedURLResponse.castFromPointer( - arg3, - retain: true, - release: true, - ), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: true, release: true), + NSCachedURLResponse.fromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.fromPointer( arg4, retain: true, release: true, @@ -73647,25 +72651,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSCachedURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.fromPointer( arg4, retain: false, release: true, @@ -73717,25 +72715,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSCachedURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.fromPointer( arg4, retain: false, release: true, @@ -73744,25 +72736,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - NSCachedURLResponse.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDataTask.fromPointer(arg2, retain: false, release: true), + NSCachedURLResponse.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.fromPointer( arg4, retain: false, release: true, @@ -73787,10 +72773,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -73814,9 +72983,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedUR ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -73825,9 +72994,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedUR void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -73843,164 +73012,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedUR late final _sel_URLSession_didCreateTask_ = objc.registerName( "URLSession:didCreateTask:", ); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { @@ -74008,7 +73019,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -74030,8 +73041,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > > @@ -74040,10 +73051,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -74067,15 +73075,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), ), keepIsolateAlive, ), @@ -74100,17 +73108,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -74139,32 +73145,28 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -74179,10 +73181,159 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -74201,8 +73352,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > >() @@ -74210,8 +73361,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); } @@ -74220,204 +73371,6 @@ late final _sel_URLSession_task_willBeginDelayedRequest_completionHandler_ = objc.registerName( "URLSession:task:willBeginDelayedRequest:completionHandler:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest { @@ -74431,7 +73384,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -74465,9 +73418,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -74483,10 +73436,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -74529,19 +73479,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLRequest.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + NSURLRequest.fromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.fromPointer( arg4, retain: true, release: true, @@ -74583,21 +73533,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLRequest.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLRequest.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.fromPointer( arg4, retain: false, release: true, @@ -74649,21 +73597,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLRequest.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLRequest.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.fromPointer( arg4, retain: false, release: true, @@ -74672,21 +73618,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLRequest.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLRequest.fromPointer(arg3, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.fromPointer( arg4, retain: false, release: true, @@ -74711,10 +73655,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -74738,9 +73865,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_f ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -74749,9 +73876,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_f void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -74767,112 +73894,11 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_f late final _sel_URLSession_taskIsWaitingForConnectivity_ = objc.registerName( "URLSession:taskIsWaitingForConnectivity:", ); -void _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSURLRequest_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLRequest_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSURLRequest_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLRequest_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSURLRequest_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSURLRequest { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -74889,14 +73915,13 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { /// will result in a crash. static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction arg0)> + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -74914,11 +73939,11 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_closureCallable, - (ffi.Pointer arg0) => fn( + _closureCallable, + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, retain: true, release: true), + : NSURLRequest.fromPointer(arg0, retain: true, release: true), ), keepIsolateAlive, ), @@ -74940,11 +73965,11 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, retain: false, release: true), + : NSURLRequest.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -74972,21 +73997,20 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, retain: false, release: true), + : NSURLRequest.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_blockingListenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : NSURLRequest.castFromPointer(arg0, retain: false, release: true), + : NSURLRequest.fromPointer(arg0, retain: false, release: true), ), keepIsolateAlive, ); @@ -75003,24 +74027,127 @@ abstract final class ObjCBlock_ffiVoid_NSURLRequest { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLRequest_CallExtension +extension ObjCBlock_ffiVoid_NSURLRequest$CallExtension on objc.ObjCBlock { void call(NSURLRequest? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } @@ -75029,221 +74156,31 @@ late final _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completion objc.registerName( "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, -) => block.ref.target +final _objc_msgSend_e1wgee = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingTrampoline, ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingTrampoline, - ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest { @@ -75258,7 +74195,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -75294,10 +74231,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) > @@ -75314,10 +74251,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -75363,25 +74297,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer( - arg3, - retain: true, - release: true, - ), - NSURLRequest.castFromPointer(arg4, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: true, release: true), + NSURLRequest.fromPointer(arg4, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLRequest.fromPointer( arg5, retain: true, release: true, @@ -75425,23 +74355,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), - NSURLRequest.castFromPointer(arg4, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), + NSURLRequest.fromPointer(arg4, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLRequest.fromPointer( arg5, retain: false, release: true, @@ -75496,23 +74424,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), - NSURLRequest.castFromPointer(arg4, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), + NSURLRequest.fromPointer(arg4, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLRequest.fromPointer( arg5, retain: false, release: true, @@ -75521,23 +74447,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), - NSURLRequest.castFromPointer(arg4, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), + NSURLRequest.fromPointer(arg4, retain: false, release: true), + ObjCBlock_ffiVoid_NSURLRequest.fromPointer( arg5, retain: false, release: true, @@ -75563,10 +74487,210 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -75592,10 +74716,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ffi.Pointer arg5, ) > @@ -75604,10 +74728,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -75625,184 +74749,41 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo /// NSURLAuthenticationChallenge in your config's objc-interfaces list. /// /// NSURLAuthenticationChallenge -class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { - NSURLAuthenticationChallenge._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSURLAuthenticationChallenge._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. - NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLAuthenticationChallenge.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. - NSURLAuthenticationChallenge.castFromPointer( - ffi.Pointer other, { + NSURLAuthenticationChallenge.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } /// WARNING: NSURLCredential is a stub. To generate bindings for this class, include /// NSURLCredential in your config's objc-interfaces list. /// /// NSURLCredential -class NSURLCredential extends objc.ObjCObjectBase { - NSURLCredential._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSURLCredential._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. - NSURLCredential.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLCredential.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [NSURLCredential] that wraps the given raw object pointer. - NSURLCredential.castFromPointer( - ffi.Pointer other, { + NSURLCredential.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); -} - -void -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) - > - >() - .asFunction)>()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - int arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function(int, ffi.Pointer))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -75821,15 +74802,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) + ffi.Void Function(NSInteger arg0, ffi.Pointer arg1) > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -75848,16 +74826,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( + _closureCallable, + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionAuthChallengeDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLCredential.castFromPointer( - arg1, - retain: true, - release: true, - ), + : NSURLCredential.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -75880,18 +74854,12 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _listenerCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionAuthChallengeDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLCredential.castFromPointer( - arg1, - retain: false, - release: true, - ), + : NSURLCredential.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -75920,34 +74888,22 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _blockingCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionAuthChallengeDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLCredential.castFromPointer( - arg1, - retain: false, - release: true, - ), + : NSURLCredential.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_blockingListenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (int arg0, ffi.Pointer arg1) => fn( NSURLSessionAuthChallengeDisposition.fromValue(arg0), arg1.address == 0 ? null - : NSURLCredential.castFromPointer( - arg1, - retain: false, - release: true, - ), + : NSURLCredential.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -75964,10 +74920,132 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + int arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSInteger arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction)>()( + arg0, + arg1, + ); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function(int, ffi.Pointer))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension +extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential$CallExtension on objc.ObjCBlock { void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => ref.pointer.ref.invoke @@ -75976,7 +75054,7 @@ extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential ffi.Void Function( ffi.Pointer block, NSInteger arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -75984,211 +75062,13 @@ extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential void Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); } late final _sel_URLSession_task_didReceiveChallenge_completionHandler_ = objc .registerName("URLSession:task:didReceiveChallenge:completionHandler:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { @@ -76202,7 +75082,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -76236,9 +75116,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -76254,10 +75134,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -76300,23 +75177,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + NSURLAuthenticationChallenge.fromPointer( arg3, retain: true, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg4, retain: true, release: true, @@ -76358,25 +75235,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg3, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg4, retain: false, release: true, @@ -76428,25 +75303,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg3, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg4, retain: false, release: true, @@ -76455,25 +75328,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg3, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg4, retain: false, release: true, @@ -76498,10 +75369,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -76525,9 +75579,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthentic ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ffi.Pointer arg4, ) > @@ -76536,9 +75590,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthentic void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -76551,112 +75605,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthentic ); } -void _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction arg0)> - >() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSInputStream_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))( - arg0, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSInputStream_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSInputStream_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSInputStream_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSInputStream_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSInputStream_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSInputStream_blockingTrampoline) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSInputStream { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -76674,14 +75626,13 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction arg0)> + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -76699,15 +75650,11 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_closureCallable, - (ffi.Pointer arg0) => fn( + _closureCallable, + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer( - arg0, - retain: true, - release: true, - ), + : objc.NSInputStream.fromPointer(arg0, retain: true, release: true), ), keepIsolateAlive, ), @@ -76729,11 +75676,11 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer( + : objc.NSInputStream.fromPointer( arg0, retain: false, release: true, @@ -76765,11 +75712,11 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_blockingCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer( + : objc.NSInputStream.fromPointer( arg0, retain: false, release: true, @@ -76778,12 +75725,11 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_blockingListenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn( arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer( + : objc.NSInputStream.fromPointer( arg0, retain: false, release: true, @@ -76804,24 +75750,127 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0) + > + >() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer))(arg0); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSInputStream_CallExtension +extension ObjCBlock_ffiVoid_NSInputStream$CallExtension on objc.ObjCBlock { void call(objc.NSInputStream? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } @@ -76829,187 +75878,27 @@ extension ObjCBlock_ffiVoid_NSInputStream_CallExtension late final _sel_URLSession_task_needNewBodyStream_ = objc.registerName( "URLSession:task:needNewBodyStream:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target +final _objc_msgSend_18qun1e = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline, ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingTrampoline, - ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream { @@ -77022,7 +75911,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -77054,8 +75943,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) > @@ -77070,10 +75959,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -77113,17 +75999,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg3, retain: true, release: true, @@ -77163,19 +76049,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg3, retain: false, release: true, @@ -77224,19 +76108,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg3, retain: false, release: true, @@ -77245,19 +76127,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg3, retain: false, release: true, @@ -77281,10 +76161,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -77306,8 +76352,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInput ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) > @@ -77316,8 +76362,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInput void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -77333,204 +76379,29 @@ late final _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = objc.registerName( "URLSession:task:needNewBodyStreamFromOffset:completionHandler:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) => block.ref.target +final _objc_msgSend_9cddqw = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Pointer arg4, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingTrampoline, - ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream { @@ -77544,7 +76415,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -77578,8 +76449,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Pointer arg4, ) @@ -77596,10 +76467,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -77642,19 +76510,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg4, retain: true, release: true, @@ -77696,21 +76564,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg4, retain: false, release: true, @@ -77762,21 +76628,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg4, retain: false, release: true, @@ -77785,21 +76649,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer( + ObjCBlock_ffiVoid_NSInputStream.fromPointer( arg4, retain: false, release: true, @@ -77824,10 +76686,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -77851,8 +76896,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidN ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Pointer arg4, ) @@ -77862,8 +76907,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidN void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ) @@ -77881,221 +76926,31 @@ late final _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpecte objc.registerName( "URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) => block.ref.target +final _objc_msgSend_1modw1b = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ) - >()(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, int, int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline, ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingTrampoline, - ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 { @@ -78110,7 +76965,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ffi.Int64, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -78146,8 +77001,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5, @@ -78166,10 +77021,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ffi.Int64, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -78215,18 +77067,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), arg3, arg4, arg5, @@ -78269,20 +77121,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, arg4, arg5, @@ -78336,20 +77186,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, arg4, arg5, @@ -78357,20 +77205,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3, arg4, arg5, @@ -78395,10 +77241,210 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ) + >()(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -78424,8 +77470,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_In ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5, @@ -78436,8 +77482,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_In void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, int, int, @@ -78455,187 +77501,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_In late final _sel_URLSession_task_didReceiveInformationalResponse_ = objc .registerName("URLSession:task:didReceiveInformationalResponse:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse { @@ -78648,7 +77513,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSHTTPURLResponse, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -78680,9 +77545,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -78696,10 +77561,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH NSHTTPURLResponse, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -78739,21 +77601,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer( - arg3, - retain: true, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: true, release: true), ), keepIsolateAlive, ), @@ -78789,19 +77647,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -78846,36 +77702,32 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSHTTPURLResponse.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -78895,10 +77747,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -78920,9 +77938,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -78930,9 +77948,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -78947,12 +77965,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo /// NSURLSessionTaskMetrics in your config's objc-interfaces list. /// /// NSURLSessionTaskMetrics -class NSURLSessionTaskMetrics extends objc.NSObject { - NSURLSessionTaskMetrics._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +extension type NSURLSessionTaskMetrics._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { + /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. + NSURLSessionTaskMetrics.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSURLSessionTaskMetrics', iOS: (false, (10, 0, 0)), @@ -78960,202 +77976,23 @@ class NSURLSessionTaskMetrics extends objc.NSObject { ); } - /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. - NSURLSessionTaskMetrics.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLSessionTaskMetrics] that wraps the given raw object pointer. - NSURLSessionTaskMetrics.castFromPointer( - ffi.Pointer other, { + NSURLSessionTaskMetrics.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSURLSessionTaskMetrics', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 12, 0)), + ); + } } late final _sel_URLSession_task_didFinishCollectingMetrics_ = objc.registerName( "URLSession:task:didFinishCollectingMetrics:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { @@ -79168,7 +78005,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTaskMetrics, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -79200,9 +78037,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -79216,10 +78053,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU NSURLSessionTaskMetrics, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -79259,17 +78093,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionTaskMetrics.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), + NSURLSessionTaskMetrics.fromPointer( arg3, retain: true, release: true, @@ -79309,23 +78143,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLSessionTaskMetrics.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionTaskMetrics.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -79370,44 +78198,32 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLSessionTaskMetrics.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionTaskMetrics.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSURLSessionTaskMetrics.castFromPointer( - arg3, - retain: false, - release: true, - ), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), + NSURLSessionTaskMetrics.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -79427,10 +78243,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -79452,9 +78434,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTa ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -79462,9 +78444,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTa void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -79478,187 +78460,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTa late final _sel_URLSession_task_didCompleteWithError_ = objc.registerName( "URLSession:task:didCompleteWithError:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { @@ -79671,7 +78472,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE objc.NSError?, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -79703,9 +78504,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -79719,10 +78520,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE objc.NSError?, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -79762,23 +78560,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionTask.fromPointer(arg2, retain: true, release: true), arg3.address == 0 ? null - : objc.NSError.castFromPointer( - arg3, - retain: true, - release: true, - ), + : objc.NSError.fromPointer(arg3, retain: true, release: true), ), keepIsolateAlive, ), @@ -79814,21 +78608,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3.address == 0 ? null - : objc.NSError.castFromPointer(arg3, retain: false, release: true), + : objc.NSError.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -79873,40 +78665,36 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3.address == 0 ? null - : objc.NSError.castFromPointer(arg3, retain: false, release: true), + : objc.NSError.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionTask.fromPointer(arg2, retain: false, release: true), arg3.address == 0 ? null - : objc.NSError.castFromPointer(arg3, retain: false, release: true), + : objc.NSError.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -79926,10 +78714,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -79951,9 +78905,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallEx ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -79961,9 +78915,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallEx void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -79977,162 +78931,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallEx late final _sel_URLSession_didBecomeInvalidWithError_ = objc.registerName( "URLSession:didBecomeInvalidWithError:", ); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { @@ -80140,7 +78938,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -80162,8 +78960,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > > @@ -80172,10 +78970,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -80199,21 +78994,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSession.fromPointer(arg1, retain: true, release: true), arg2.address == 0 ? null - : objc.NSError.castFromPointer( - arg2, - retain: true, - release: true, - ), + : objc.NSError.fromPointer(arg2, retain: true, release: true), ), keepIsolateAlive, ), @@ -80238,19 +79029,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), arg2.address == 0 ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -80279,36 +79068,32 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), arg2.address == 0 ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), arg2.address == 0 ? null - : objc.NSError.castFromPointer(arg2, retain: false, release: true), + : objc.NSError.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -80323,10 +79108,159 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError$CallExtension on objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?) @@ -80342,8 +79276,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > >() @@ -80351,8 +79285,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -80364,187 +79298,6 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension late final _sel_URLSession_didReceiveChallenge_completionHandler_ = objc .registerName("URLSession:didReceiveChallenge:completionHandler:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { @@ -80557,7 +79310,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -80589,8 +79342,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) > @@ -80605,10 +79358,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -80648,21 +79398,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLAuthenticationChallenge.fromPointer( arg2, retain: true, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg3, retain: true, release: true, @@ -80702,23 +79452,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg2, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg3, retain: false, release: true, @@ -80767,23 +79515,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg2, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg3, retain: false, release: true, @@ -80792,23 +79538,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLAuthenticationChallenge.fromPointer( arg2, retain: false, release: true, ), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer( + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.fromPointer( arg3, retain: false, release: true, @@ -80832,10 +79576,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -80857,8 +79767,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ff ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Pointer arg3, ) > @@ -80867,8 +79777,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ff void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()( @@ -80882,140 +79792,12 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ff late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = objc .registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock, NSURLSession)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -81036,16 +79818,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock, NSURLSession)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -81064,11 +79843,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { bool keepIsolateAlive = true, }) => objc.ObjCBlock, NSURLSession)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - ), + _closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, NSURLSession.fromPointer(arg1, retain: true, release: true)), keepIsolateAlive, ), retain: false, @@ -81090,11 +79867,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -81121,21 +79897,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), + NSURLSession.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -81150,10 +79923,139 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { ffi.Void Function(ffi.Pointer, NSURLSession) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession$CallExtension on objc.ObjCBlock, NSURLSession)> { void call(ffi.Pointer arg0, NSURLSession arg1) => ref .pointer @@ -81164,7 +80066,7 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -81172,44 +80074,696 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer); } /// Messages related to the operation of a task that delivers data /// directly to the delegate. -interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase - implements NSURLSessionTaskDelegate { - NSURLSessionDataDelegate._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSURLSessionDataDelegate._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, NSURLSessionTaskDelegate { /// Constructs a [NSURLSessionDataDelegate] that points to the same underlying object as [other]. - NSURLSessionDataDelegate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLSessionDataDelegate.as(objc.ObjCObject other) : object$ = other; /// Constructs a [NSURLSessionDataDelegate] that wraps the given raw object pointer. - NSURLSessionDataDelegate.castFromPointer( - ffi.Pointer other, { + NSURLSessionDataDelegate.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); /// Returns whether [obj] is an instance of [NSURLSessionDataDelegate]. - static bool conformsTo(objc.ObjCObjectBase obj) { + static bool conformsTo(objc.ObjCObject obj) { return _objc_msgSend_e3qsqz( obj.ref.pointer, _sel_conformsToProtocol_, _protocol_NSURLSessionDataDelegate, ); } +} + +extension NSURLSessionDataDelegate$Methods on NSURLSessionDataDelegate { + /// Notification that a data task has become a download task. No + /// future messages will be sent to the data task. + void URLSession( + NSURLSession session, { + required NSURLSessionDataTask dataTask, + required NSURLSessionDownloadTask didBecomeDownloadTask, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:dataTask:didBecomeDownloadTask:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:dataTask:didBecomeDownloadTask:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + session.ref.pointer, + dataTask.ref.pointer, + didBecomeDownloadTask.ref.pointer, + ); + } + + /// Notification that a data task has become a bidirectional stream + /// task. No future messages will be sent to the data task. The newly + /// created streamTask will carry the original request and response as + /// properties. + /// + /// For requests that were pipelined, the stream object will only allow + /// reading, and the object will immediately issue a + /// -URLSession:writeClosedForStream:. Pipelining can be disabled for + /// all requests in a session, or by the NSURLRequest + /// HTTPShouldUsePipelining property. + /// + /// The underlying connection is no longer considered part of the HTTP + /// connection cache and won't count against the total number of + /// connections per host. + void URLSession$1( + NSURLSession session, { + required NSURLSessionDataTask dataTask, + required NSURLSessionStreamTask didBecomeStreamTask, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:dataTask:didBecomeStreamTask:', + iOS: (false, (9, 0, 0)), + macOS: (false, (10, 11, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_dataTask_didBecomeStreamTask_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:dataTask:didBecomeStreamTask:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_dataTask_didBecomeStreamTask_, + session.ref.pointer, + dataTask.ref.pointer, + didBecomeStreamTask.ref.pointer, + ); + } + + /// Sent when data is available for the delegate to consume. As the + /// data may be discontiguous, you should use + /// [NSData enumerateByteRangesUsingBlock:] to access it. + void URLSession$2( + NSURLSession session, { + required NSURLSessionDataTask dataTask, + required objc.NSData didReceiveData, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:dataTask:didReceiveData:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_dataTask_didReceiveData_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:dataTask:didReceiveData:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_dataTask_didReceiveData_, + session.ref.pointer, + dataTask.ref.pointer, + didReceiveData.ref.pointer, + ); + } + + /// The task has received a response and no further messages will be + /// received until the completion block is called. The disposition + /// allows you to cancel a request or to turn a data task into a + /// download task. This delegate message is optional - if you do not + /// implement it, you can get the response as a property of the task. + /// + /// This method will not be called for background upload tasks (which cannot be converted to download tasks). + void URLSession$3( + NSURLSession session, { + required NSURLSessionDataTask dataTask, + required NSURLResponse didReceiveResponse, + required objc.ObjCBlock completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:dataTask:didReceiveResponse:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:dataTask:didReceiveResponse:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + session.ref.pointer, + dataTask.ref.pointer, + didReceiveResponse.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Invoke the completion routine with a valid NSCachedURLResponse to + /// allow the resulting data to be cached, or pass nil to prevent + /// caching. Note that there is no guarantee that caching will be + /// attempted for a given resource, and you should not rely on this + /// message to receive the resource data. + void URLSession$4( + NSURLSession session, { + required NSURLSessionDataTask dataTask, + required NSCachedURLResponse willCacheResponse, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:dataTask:willCacheResponse:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:dataTask:willCacheResponse:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + session.ref.pointer, + dataTask.ref.pointer, + willCacheResponse.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + void URLSession$5( + NSURLSession session, { + objc.NSError? didBecomeInvalidWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:didBecomeInvalidWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:didBecomeInvalidWithError:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + session.ref.pointer, + didBecomeInvalidWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + void URLSession$6( + NSURLSession session, { + required NSURLSessionTask didCreateTask, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:didCreateTask:', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:didCreateTask:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + session.ref.pointer, + didCreateTask.ref.pointer, + ); + } + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + void URLSession$7( + NSURLSession session, { + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + session.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + void URLSession$8( + NSURLSession session, { + required NSURLSessionTask task, + objc.NSError? didCompleteWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:didCompleteWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:didCompleteWithError:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + session.ref.pointer, + task.ref.pointer, + didCompleteWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Sent when complete statistics information has been collected for the task. + void URLSession$9( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLSessionTaskMetrics didFinishCollectingMetrics, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:didFinishCollectingMetrics:', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 12, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:didFinishCollectingMetrics:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + session.ref.pointer, + task.ref.pointer, + didFinishCollectingMetrics.ref.pointer, + ); + } + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + void URLSession$10( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + session.ref.pointer, + task.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent for each informational response received except 101 switching protocols. + void URLSession$11( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse didReceiveInformationalResponse, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:didReceiveInformationalResponse:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:didReceiveInformationalResponse:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + session.ref.pointer, + task.ref.pointer, + didReceiveInformationalResponse.ref.pointer, + ); + } + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + void URLSession$12( + NSURLSession session, { + required NSURLSessionTask task, + required int didSendBodyData, + required int totalBytesSent, + required int totalBytesExpectedToSend, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + ); + } + _objc_msgSend_1modw1b( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + session.ref.pointer, + task.ref.pointer, + didSendBodyData, + totalBytesSent, + totalBytesExpectedToSend, + ); + } + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + void URLSession$13( + NSURLSession session, { + required NSURLSessionTask task, + required objc.ObjCBlock + needNewBodyStream, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:needNewBodyStream:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:needNewBodyStream:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStream.ref.pointer, + ); + } + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + void URLSession$14( + NSURLSession session, { + required NSURLSessionTask task, + required int needNewBodyStreamFromOffset, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + ); + } + _objc_msgSend_9cddqw( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStreamFromOffset, + completionHandler.ref.pointer, + ); + } + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + void URLSession$15( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLRequest willBeginDelayedRequest, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:willBeginDelayedRequest:completionHandler:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:willBeginDelayedRequest:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willBeginDelayedRequest.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + void URLSession$16( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse willPerformHTTPRedirection, + required NSURLRequest newRequest, + required objc.ObjCBlock completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + ); + } + _objc_msgSend_e1wgee( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willPerformHTTPRedirection.ref.pointer, + newRequest.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + void URLSession$17( + NSURLSession session, { + required NSURLSessionTask taskIsWaitingForConnectivity, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSession:taskIsWaitingForConnectivity:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSession:taskIsWaitingForConnectivity:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + session.ref.pointer, + taskIsWaitingForConnectivity.ref.pointer, + ); + } + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + void URLSessionDidFinishEventsForBackgroundURLSession(NSURLSession session) { + objc.checkOsVersionInternal( + 'NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession:', + iOS: (false, (7, 0, 0)), + macOS: (false, (11, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDataDelegate', + 'URLSessionDidFinishEventsForBackgroundURLSession:', + ); + } + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + session.ref.pointer, + ); + } +} +interface class NSURLSessionDataDelegate$Builder { /// Returns the [objc.Protocol] object for this protocol. static objc.Protocol get $protocol => - objc.Protocol.castFromPointer(_protocol_NSURLSessionDataDelegate.cast()); + objc.Protocol.fromPointer(_protocol_NSURLSessionDataDelegate.cast()); /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. @@ -81217,6 +80771,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDataDelegate implement({ + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81224,12 +80784,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81237,24 +80791,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -81262,6 +80811,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -81275,22 +80828,23 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -81298,96 +80852,102 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDataDelegate', ); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implement( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implement( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didBecomeStreamTask_.implement( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveData_.implement( + builder, + URLSession_dataTask_didReceiveData_, + ); + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implement( builder, - URLSession_dataTask_didReceiveData_, + URLSession_dataTask_didReceiveResponse_completionHandler_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implement( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDataDelegate.castFrom( + return NSURLSessionDataDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -81398,6 +80958,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilder( objc.ObjCProtocolBuilder builder, { + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81405,12 +80971,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81418,24 +80978,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -81443,6 +80998,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -81456,110 +81015,117 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implement( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implement( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didBecomeStreamTask_.implement( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveData_.implement( builder, URLSession_dataTask_didReceiveData_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implement( + builder, + URLSession_dataTask_didReceiveResponse_completionHandler_, + ); + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implement( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -81574,6 +81140,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDataDelegate implementAsListener({ + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81581,12 +81153,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81594,24 +81160,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -81619,6 +81180,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -81632,22 +81197,23 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -81655,102 +81221,103 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDataDelegate', ); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsListener( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implementAsListener( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeStreamTask_.implementAsListener( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didReceiveData_.implementAsListener( builder, URLSession_dataTask_didReceiveData_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsListener( + builder, + URLSession_dataTask_didReceiveResponse_completionHandler_, + ); + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implementAsListener( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStream_.implementAsListener( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDataDelegate.castFrom( + return NSURLSessionDataDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -81762,6 +81329,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener( objc.ObjCProtocolBuilder builder, { + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81769,12 +81342,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81782,24 +81349,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -81807,6 +81369,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -81820,116 +81386,118 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsListener( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implementAsListener( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeStreamTask_.implementAsListener( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didReceiveData_.implementAsListener( builder, URLSession_dataTask_didReceiveData_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsListener( + builder, + URLSession_dataTask_didReceiveResponse_completionHandler_, + ); + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implementAsListener( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStream_.implementAsListener( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -81944,6 +81512,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDataDelegate implementAsBlocking({ + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81951,12 +81525,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -81964,24 +81532,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -81989,6 +81552,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -82002,22 +81569,23 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -82025,102 +81593,103 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDataDelegate', ); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsBlocking( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implementAsBlocking( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeStreamTask_.implementAsBlocking( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didReceiveData_.implementAsBlocking( builder, URLSession_dataTask_didReceiveData_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsBlocking( + builder, + URLSession_dataTask_didReceiveResponse_completionHandler_, + ); + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implementAsBlocking( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStream_.implementAsBlocking( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDataDelegate.castFrom( + return NSURLSessionDataDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -82132,6 +81701,12 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking( objc.ObjCProtocolBuilder builder, { + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -82139,12 +81714,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, void Function( NSURLSession, NSURLSessionDataTask, @@ -82152,24 +81721,19 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -82177,6 +81741,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -82190,116 +81758,118 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsBlocking( - builder, - URLSession_dataTask_didReceiveResponse_completionHandler_, - ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeDownloadTask_.implementAsBlocking( builder, URLSession_dataTask_didBecomeDownloadTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didBecomeStreamTask_.implementAsBlocking( builder, URLSession_dataTask_didBecomeStreamTask_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_dataTask_didReceiveData_.implementAsBlocking( builder, URLSession_dataTask_didReceiveData_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder + .URLSession_dataTask_didReceiveResponse_completionHandler_.implementAsBlocking( + builder, + URLSession_dataTask_didReceiveResponse_completionHandler_, + ); + NSURLSessionDataDelegate$Builder .URLSession_dataTask_willCacheResponse_completionHandler_.implementAsBlocking( builder, URLSession_dataTask_willCacheResponse_completionHandler_, ); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDataDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, URLSession_didCreateTask_, ); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStream_.implementAsBlocking( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDataDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDataDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDataDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionDataDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDataDelegate + NSURLSessionDataDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -82307,99 +81877,6 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase builder.addProtocol($protocol); } - /// The task has received a response and no further messages will be - /// received until the completion block is called. The disposition - /// allows you to cancel a request or to turn a data task into a - /// download task. This delegate message is optional - if you do not - /// implement it, you can get the response as a property of the task. - /// - /// This method will not be called for background upload tasks (which cannot be converted to download tasks). - static final URLSession_dataTask_didReceiveResponse_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock, - ) - >( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_xx612k) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - ( - void Function( - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4, - ) => func(arg1, arg2, arg3, arg4), - ), - ( - void Function( - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4, - ) => func(arg1, arg2, arg3, arg4), - ), - ( - void Function( - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4, - ) => func(arg1, arg2, arg3, arg4), - ), - ); - /// Notification that a data task has become a download task. No /// future messages will be sent to the data task. static final URLSession_dataTask_didBecomeDownloadTask_ = @@ -82415,11 +81892,11 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) @@ -82507,11 +81984,11 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) @@ -82584,11 +82061,11 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) @@ -82628,6 +82105,99 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ), ); + /// The task has received a response and no further messages will be + /// received until the completion block is called. The disposition + /// allows you to cancel a request or to turn a data task into a + /// download task. This delegate message is optional - if you do not + /// implement it, you can get the response as a property of the task. + /// + /// This method will not be called for background upload tasks (which cannot be converted to download tasks). + static final URLSession_dataTask_didReceiveResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock, + ) + >( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_xx612k) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + ( + void Function( + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4, + ) => func(arg1, arg2, arg3, arg4), + ), + ( + void Function( + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4, + ) => func(arg1, arg2, arg3, arg4), + ), + ( + void Function( + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4, + ) => func(arg1, arg2, arg3, arg4), + ), + ); + /// Invoke the completion routine with a valid NSCachedURLResponse to /// allow the resulting data to be cached, or pass nil to prevent /// caching. Note that there is no guarantee that caching will be @@ -82647,11 +82217,11 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -82719,6 +82289,58 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ), ); + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, objc.NSError?) + >( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + ); + /// Notification that a task has been created. This method is the first message /// a task sends, providing a place to configure the task before it is resumed. /// @@ -82733,10 +82355,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) @@ -82773,272 +82395,210 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ), ); - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = objc.ObjCProtocolListenableMethod< void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_didReceiveChallenge_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_xx612k) + >(_NativeCupertinoHttp_protocolTrampoline_bklti2) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ( void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ( void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ); - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask) + void Function(NSURLSession, NSURLSessionTask, objc.NSError?) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didCompleteWithError_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didCompleteWithError_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), ); - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ); @@ -83060,11 +82620,11 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -83135,6 +82695,129 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ), ); + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) + >( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int) + >( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + ); + /// Sent if a task requires a new, unopened body stream. This may be /// necessary when authentication has failed for any request that /// involves a body stream. @@ -83151,10 +82834,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -83237,10 +82920,10 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Pointer, ) @@ -83309,385 +82992,272 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ), ); - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int) - >( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_h68abb) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_xx612k) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ); - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), - ), - ); - - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?) - >( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didCompleteWithError_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ); - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, objc.NSError?) + void Function(NSURLSession, NSURLSessionTask) >( _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didBecomeInvalidWithError_, + _sel_URLSession_taskIsWaitingForConnectivity_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), - ), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - >( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_bklti2) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), + NSURLSessionTask arg2, + ) => func(arg1, arg2), ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), + NSURLSessionTask arg2, + ) => func(arg1, arg2), ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), + NSURLSessionTask arg2, + ) => func(arg1, arg2), ), ); @@ -83705,9 +83275,9 @@ interface class NSURLSessionDataDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_18v1jvf) @@ -83738,187 +83308,6 @@ late final _protocol_NSURLSessionDownloadDelegate = objc.getProtocol( ); late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = objc .registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { @@ -83931,7 +83320,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload objc.NSURL, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -83963,9 +83352,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -83979,10 +83368,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload objc.NSURL, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -84022,21 +83408,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: true, release: true, ), - objc.NSURL.castFromPointer(arg3, retain: true, release: true), + objc.NSURL.fromPointer(arg3, retain: true, release: true), ), keepIsolateAlive, ), @@ -84072,23 +83458,21 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, ), - objc.NSURL.castFromPointer(arg3, retain: false, release: true), + objc.NSURL.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -84133,44 +83517,40 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, ), - objc.NSURL.castFromPointer(arg3, retain: false, release: true), + objc.NSURL.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, ), - objc.NSURL.castFromPointer(arg3, retain: false, release: true), + objc.NSURL.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -84190,10 +83570,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -84215,9 +83761,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_ ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -84225,9 +83771,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_ void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -84242,221 +83788,6 @@ late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalByte objc.registerName( "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:", ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ) - >()(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { @@ -84471,7 +83802,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.Int64, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -84507,8 +83838,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5, @@ -84527,10 +83858,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.Int64, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -84576,18 +83904,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: true, release: true, @@ -84634,20 +83962,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, @@ -84705,20 +84031,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, @@ -84730,20 +84054,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, int arg5, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: false, release: true, @@ -84772,10 +84094,210 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ) + >()(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4, arg5); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -84801,8 +84323,8 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5, @@ -84813,225 +84335,50 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, int, int, ) >()( ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3, - arg4, - arg5, - ); -} - -late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = - objc.registerName( - "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:", - ); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3, + arg4, + arg5, + ); } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingListenerCallable = - ffi.NativeCallable< +late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.registerName( + "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:", + ); +final _objc_msgSend_fm5719 = objc.msgSendPointer + .cast< + ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Int64, ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingTrampoline, + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { @@ -85045,7 +84392,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.Int64, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -85079,8 +84426,8 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ) @@ -85097,10 +84444,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.Int64, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -85143,17 +84487,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.fromPointer( arg2, retain: true, release: true, @@ -85167,243 +84511,985 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload release: true, ); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ) + > + listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + int, + int, + ) + fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) => fn( + arg0, + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( + arg2, + retain: false, + release: true, + ), + arg3, + arg4, + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ly2579(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ) + >(wrapper, retain: false, release: true); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ) + > + blocking( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + int, + int, + ) + fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) => fn( + arg0, + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( + arg2, + retain: false, + release: true, + ), + arg3, + arg4, + ), + keepIsolateAlive, + ); + final rawListener = objc.newClosureBlock( + _blockingListenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) => fn( + arg0, + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionDownloadTask.fromPointer( + arg2, + retain: false, + release: true, + ), + arg3, + arg4, + ), + keepIsolateAlive, + ); + final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_ly2579( + raw, + rawListener, + objc.objCContext, + ); + objc.objectRelease(raw.cast()); + objc.objectRelease(rawListener.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ) + >(wrapper, retain: false, release: true); + } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64$CallExtension + on + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ) + > { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + ) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ) + >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); +} + +/// Messages related to the operation of a task that writes data to a +/// file and notifies the delegate upon completion. +extension type NSURLSessionDownloadDelegate._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, NSURLSessionTaskDelegate { + /// Constructs a [NSURLSessionDownloadDelegate] that points to the same underlying object as [other]. + NSURLSessionDownloadDelegate.as(objc.ObjCObject other) : object$ = other; + + /// Constructs a [NSURLSessionDownloadDelegate] that wraps the given raw object pointer. + NSURLSessionDownloadDelegate.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadDelegate]. + static bool conformsTo(objc.ObjCObject obj) { + return _objc_msgSend_e3qsqz( + obj.ref.pointer, + _sel_conformsToProtocol_, + _protocol_NSURLSessionDownloadDelegate, + ); + } +} + +extension NSURLSessionDownloadDelegate$Methods on NSURLSessionDownloadDelegate { + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + void URLSession$5( + NSURLSession session, { + objc.NSError? didBecomeInvalidWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:didBecomeInvalidWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:didBecomeInvalidWithError:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + session.ref.pointer, + didBecomeInvalidWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + void URLSession$6( + NSURLSession session, { + required NSURLSessionTask didCreateTask, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:didCreateTask:', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:didCreateTask:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + session.ref.pointer, + didCreateTask.ref.pointer, + ); + } + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + void URLSession$7( + NSURLSession session, { + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + session.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent when a download task that has completed a download. The delegate should + /// copy or move the file at the given location to a new location as it will be + /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will + /// still be called. + void URLSession( + NSURLSession session, { + required NSURLSessionDownloadTask downloadTask, + required objc.NSURL didFinishDownloadingToURL, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:downloadTask:didFinishDownloadingToURL:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + session.ref.pointer, + downloadTask.ref.pointer, + didFinishDownloadingToURL.ref.pointer, + ); + } + + /// Sent when a download has been resumed. If a download failed with an + /// error, the -userInfo dictionary of the error will contain an + /// NSURLSessionDownloadTaskResumeData key, whose value is the resume + /// data. + void URLSession$1( + NSURLSession session, { + required NSURLSessionDownloadTask downloadTask, + required int didResumeAtOffset, + required int expectedTotalBytes, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:', + ); + } + _objc_msgSend_fm5719( + object$.ref.pointer, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + session.ref.pointer, + downloadTask.ref.pointer, + didResumeAtOffset, + expectedTotalBytes, + ); + } + + /// Sent periodically to notify the delegate of download progress. + void URLSession$2( + NSURLSession session, { + required NSURLSessionDownloadTask downloadTask, + required int didWriteData, + required int totalBytesWritten, + required int totalBytesExpectedToWrite, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:', + ); + } + _objc_msgSend_1modw1b( + object$.ref.pointer, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + session.ref.pointer, + downloadTask.ref.pointer, + didWriteData, + totalBytesWritten, + totalBytesExpectedToWrite, + ); + } + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + void URLSession$8( + NSURLSession session, { + required NSURLSessionTask task, + objc.NSError? didCompleteWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:didCompleteWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:didCompleteWithError:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + session.ref.pointer, + task.ref.pointer, + didCompleteWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Sent when complete statistics information has been collected for the task. + void URLSession$9( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLSessionTaskMetrics didFinishCollectingMetrics, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:didFinishCollectingMetrics:', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 12, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:didFinishCollectingMetrics:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + session.ref.pointer, + task.ref.pointer, + didFinishCollectingMetrics.ref.pointer, + ); + } + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + void URLSession$10( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + session.ref.pointer, + task.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent for each informational response received except 101 switching protocols. + void URLSession$11( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse didReceiveInformationalResponse, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:didReceiveInformationalResponse:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:didReceiveInformationalResponse:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + session.ref.pointer, + task.ref.pointer, + didReceiveInformationalResponse.ref.pointer, + ); + } + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + void URLSession$12( + NSURLSession session, { + required NSURLSessionTask task, + required int didSendBodyData, + required int totalBytesSent, + required int totalBytesExpectedToSend, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + ); + } + _objc_msgSend_1modw1b( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + session.ref.pointer, + task.ref.pointer, + didSendBodyData, + totalBytesSent, + totalBytesExpectedToSend, + ); + } + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + void URLSession$13( + NSURLSession session, { + required NSURLSessionTask task, + required objc.ObjCBlock + needNewBodyStream, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:needNewBodyStream:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:needNewBodyStream:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStream.ref.pointer, + ); + } + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ) - > - listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - int, - int, - ) - fn, { - bool keepIsolateAlive = true, + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + void URLSession$14( + NSURLSession session, { + required NSURLSessionTask task, + required int needNewBodyStreamFromOffset, + required objc.ObjCBlock + completionHandler, }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - ) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - arg3, - arg4, - ), - keepIsolateAlive, + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + ); + } + _objc_msgSend_9cddqw( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStreamFromOffset, + completionHandler.ref.pointer, ); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ly2579(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ) - >(wrapper, retain: false, release: true); } - /// Creates a blocking block from a Dart function. + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions are not supported. + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ) - > - blocking( - void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - int, - int, - ) - fn, { - bool keepIsolateAlive = true, + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + void URLSession$15( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLRequest willBeginDelayedRequest, + required objc.ObjCBlock + completionHandler, }) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - ) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - arg3, - arg4, - ), - keepIsolateAlive, - ); - final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_blockingListenerCallable - .nativeFunction - .cast(), - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - ) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer( - arg2, - retain: false, - release: true, - ), - arg3, - arg4, - ), - keepIsolateAlive, + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:willBeginDelayedRequest:completionHandler:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_ly2579( - raw, - rawListener, - objc.objCContext, + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:willBeginDelayedRequest:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willBeginDelayedRequest.ref.pointer, + completionHandler.ref.pointer, ); - objc.objectRelease(raw.cast()); - objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ) - >(wrapper, retain: false, release: true); } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension - on - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ) - > { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - ) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ) - >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); -} - -/// Messages related to the operation of a task that writes data to a -/// file and notifies the delegate upon completion. -interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase - implements NSURLSessionTaskDelegate { - NSURLSessionDownloadDelegate._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - /// Constructs a [NSURLSessionDownloadDelegate] that points to the same underlying object as [other]. - NSURLSessionDownloadDelegate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + void URLSession$16( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse willPerformHTTPRedirection, + required NSURLRequest newRequest, + required objc.ObjCBlock completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + ); + } + _objc_msgSend_e1wgee( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willPerformHTTPRedirection.ref.pointer, + newRequest.ref.pointer, + completionHandler.ref.pointer, + ); + } - /// Constructs a [NSURLSessionDownloadDelegate] that wraps the given raw object pointer. - NSURLSessionDownloadDelegate.castFromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : this._(other, retain: retain, release: release); + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + void URLSession$17( + NSURLSession session, { + required NSURLSessionTask taskIsWaitingForConnectivity, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSession:taskIsWaitingForConnectivity:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSession:taskIsWaitingForConnectivity:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + session.ref.pointer, + taskIsWaitingForConnectivity.ref.pointer, + ); + } - /// Returns whether [obj] is an instance of [NSURLSessionDownloadDelegate]. - static bool conformsTo(objc.ObjCObjectBase obj) { - return _objc_msgSend_e3qsqz( - obj.ref.pointer, - _sel_conformsToProtocol_, - _protocol_NSURLSessionDownloadDelegate, + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + void URLSessionDidFinishEventsForBackgroundURLSession(NSURLSession session) { + objc.checkOsVersionInternal( + 'NSURLSessionDownloadDelegate.URLSessionDidFinishEventsForBackgroundURLSession:', + iOS: (false, (7, 0, 0)), + macOS: (false, (11, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionDownloadDelegate', + 'URLSessionDidFinishEventsForBackgroundURLSession:', + ); + } + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + session.ref.pointer, ); } +} +interface class NSURLSessionDownloadDelegate$Builder { /// Returns the [objc.Protocol] object for this protocol. - static objc.Protocol get $protocol => objc.Protocol.castFromPointer( - _protocol_NSURLSessionDownloadDelegate.cast(), - ); + static objc.Protocol get $protocol => + objc.Protocol.fromPointer(_protocol_NSURLSessionDownloadDelegate.cast()); /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. @@ -85411,30 +85497,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDownloadDelegate implement({ - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -85442,6 +85523,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -85455,22 +85540,23 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -85478,91 +85564,92 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDownloadDelegate', ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implement( + NSURLSessionDownloadDelegate$Builder.URLSession_didCreateTask_.implement( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_didCreateTask_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implement( builder, - URLSession_didCreateTask_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_didReceiveChallenge_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_task_needNewBodyStream_, + URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDownloadDelegate.castFrom( + return NSURLSessionDownloadDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -85573,30 +85660,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilder( objc.ObjCProtocolBuilder builder, { - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -85604,6 +85686,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -85617,105 +85703,107 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( + builder, + URLSession_didBecomeInvalidWithError_, + ); + NSURLSessionDownloadDelegate$Builder.URLSession_didCreateTask_.implement( + builder, + URLSession_didCreateTask_, + ); + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implement( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implement( builder, URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( - builder, - URLSession_didCreateTask_, - ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -85730,30 +85818,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDownloadDelegate implementAsListener({ - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -85761,6 +85844,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -85774,22 +85861,23 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -85797,92 +85885,93 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDownloadDelegate', ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_didCreateTask_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsListener( builder, - URLSession_didCreateTask_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_didReceiveChallenge_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStream_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_needNewBodyStream_, + URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDownloadDelegate.castFrom( + return NSURLSessionDownloadDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -85894,30 +85983,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener( objc.ObjCProtocolBuilder builder, { - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -85925,6 +86009,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -85938,106 +86026,108 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_didCreateTask_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsListener( builder, - URLSession_didCreateTask_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_didReceiveChallenge_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStream_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_needNewBodyStream_, + URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -86052,30 +86142,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionDownloadDelegate implementAsBlocking({ - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -86083,6 +86168,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -86096,22 +86185,23 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -86119,92 +86209,93 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionDownloadDelegate', ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_didCreateTask_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsBlocking( builder, - URLSession_didCreateTask_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_didReceiveChallenge_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStream_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_task_needNewBodyStream_, + URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionDownloadDelegate.castFrom( + return NSURLSessionDownloadDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -86216,30 +86307,25 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking( objc.ObjCProtocolBuilder builder, { - required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -86247,6 +86333,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -86260,106 +86350,108 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( builder, - URLSession_downloadTask_didFinishDownloadingToURL_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + URLSession_didCreateTask_, ); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didFinishDownloadingToURL_.implementAsBlocking( builder, - URLSession_didCreateTask_, + URLSession_downloadTask_didFinishDownloadingToURL_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, ); - NSURLSessionDownloadDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + ); + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( + builder, + URLSession_task_didCompleteWithError_, ); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStream_.implementAsBlocking( - builder, - URLSession_task_needNewBodyStream_, - ); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + URLSession_task_didReceiveInformationalResponse_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_needNewBodyStream_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionDownloadDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionDownloadDelegate + NSURLSessionDownloadDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -86367,140 +86459,264 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase builder.addProtocol($protocol); } - /// Sent when a download task that has completed a download. The delegate should - /// copy or move the file at the given location to a new location as it will be - /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will - /// still be called. - static final URLSession_downloadTask_didFinishDownloadingToURL_ = + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + void Function(NSURLSession, objc.NSError?) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + _sel_URLSession_didBecomeInvalidWithError_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, - isRequired: true, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + objc.NSError? arg2, + ) => func(arg1, arg2), + ), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask) + >( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didCreateTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) + >( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_bklti2) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + void Function( + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, - objc.NSURL arg3, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, ) => func(arg1, arg2, arg3), ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + void Function( + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, - objc.NSURL arg3, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, ) => func(arg1, arg2, arg3), ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + void Function( + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, - objc.NSURL arg3, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, ) => func(arg1, arg2, arg3), ), ); - /// Sent periodically to notify the delegate of download progress. - static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + /// Sent when a download task that has completed a download. The delegate should + /// copy or move the file at the given location to a new location as it will be + /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will + /// still be called. + static final URLSession_downloadTask_didFinishDownloadingToURL_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_h68abb) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - isRequired: false, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + isRequired: true, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + objc.NSURL arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + objc.NSURL arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + objc.NSURL arg3, + ) => func(arg1, arg2, arg3), ), ); @@ -86517,10 +86733,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Int64, ) @@ -86571,326 +86787,192 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ), ); - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask) - >( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didCreateTask_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - ) => func(arg1, arg2), - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - ) => func(arg1, arg2), - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - ) => func(arg1, arg2), - ), - ); - - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + /// Sent periodically to notify the delegate of download progress. + static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, ) > - >(_NativeCupertinoHttp_protocolTrampoline_xx612k) + >(_NativeCupertinoHttp_protocolTrampoline_h68abb) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ); - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask) + void Function(NSURLSession, NSURLSessionTask, objc.NSError?) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didCompleteWithError_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didCompleteWithError_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), ); - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ); @@ -86912,11 +86994,11 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -86987,6 +87069,129 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ), ); + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) + >( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int) + >( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_h68abb) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), + ), + ); + /// Sent if a task requires a new, unopened body stream. This may be /// necessary when authentication has failed for any request that /// involves a body stream. @@ -87003,10 +87208,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -87089,10 +87294,10 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Pointer, ) @@ -87161,388 +87366,275 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ), ); - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int) - >( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_h68abb) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_xx612k) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ); - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), - ), - ); - - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?) - >( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didCompleteWithError_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ); - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, objc.NSError?) + void Function(NSURLSession, NSURLSessionTask) >( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didBecomeInvalidWithError_, + _sel_URLSession_taskIsWaitingForConnectivity_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didBecomeInvalidWithError_, + _sel_URLSession_taskIsWaitingForConnectivity_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, + NSURLSessionTask arg2, ) => func(arg1, arg2), ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, + NSURLSessionTask arg2, ) => func(arg1, arg2), ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, + NSURLSessionTask arg2, ) => func(arg1, arg2), ), ); - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - >( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_bklti2) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), - ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), - ), - ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, - ) => func(arg1, arg2, arg3), - ), - ); - /// If an application has received an /// -application:handleEventsForBackgroundURLSession:completionHandler: /// message, the session delegate will receive this message to indicate @@ -87557,9 +87649,9 @@ interface class NSURLSessionDownloadDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_18v1jvf) @@ -87590,187 +87682,6 @@ late final _protocol_NSURLSessionWebSocketDelegate = objc.getProtocol( ); late final _sel_URLSession_webSocketTask_didOpenWithProtocol_ = objc .registerName("URLSession:webSocketTask:didOpenWithProtocol:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingTrampoline, - ) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString { @@ -87783,7 +87694,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke objc.NSString?, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -87815,9 +87726,9 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > > @@ -87831,10 +87742,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke objc.NSString?, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -87874,27 +87782,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: true, release: true, ), arg3.address == 0 ? null - : objc.NSString.castFromPointer( - arg3, - retain: true, - release: true, - ), + : objc.NSString.fromPointer(arg3, retain: true, release: true), ), keepIsolateAlive, ), @@ -87930,25 +87834,23 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, ), arg3.address == 0 ? null - : objc.NSString.castFromPointer(arg3, retain: false, release: true), + : objc.NSString.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -87993,48 +87895,44 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, ), arg3.address == 0 ? null - : objc.NSString.castFromPointer(arg3, retain: false, release: true), + : objc.NSString.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, ), arg3.address == 0 ? null - : objc.NSString.castFromPointer(arg3, retain: false, release: true), + : objc.NSString.fromPointer(arg3, retain: false, release: true), ), keepIsolateAlive, ); @@ -88054,10 +87952,176 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -88079,9 +88143,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSStr ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) > >() @@ -88089,9 +88153,9 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSStr void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -88104,204 +88168,29 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSStr late final _sel_URLSession_webSocketTask_didCloseWithCode_reason_ = objc .registerName("URLSession:webSocketTask:didCloseWithCode:reason:"); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) => block.ref.target +final _objc_msgSend_d9bpjb = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - NSInteger arg3, - ffi.Pointer arg4, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, ) > >() .asFunction< void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ) - >()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ))(arg0, arg1, arg2, arg3, arg4); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingTrampoline, + ffi.Pointer, ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingTrampoline, - ) - ..keepIsolateAlive = false; + >(); /// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData { @@ -88315,7 +88204,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke objc.NSData?, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -88349,10 +88238,10 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, NSInteger arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) > > @@ -88367,10 +88256,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke objc.NSData?, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -88413,17 +88299,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: true, release: true, @@ -88431,11 +88317,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3, arg4.address == 0 ? null - : objc.NSData.castFromPointer( - arg4, - retain: true, - release: true, - ), + : objc.NSData.fromPointer(arg4, retain: true, release: true), ), keepIsolateAlive, ), @@ -88473,19 +88355,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, @@ -88493,7 +88373,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3, arg4.address == 0 ? null - : objc.NSData.castFromPointer(arg4, retain: false, release: true), + : objc.NSData.fromPointer(arg4, retain: false, release: true), ), keepIsolateAlive, ); @@ -88541,19 +88421,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, @@ -88561,24 +88439,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3, arg4.address == 0 ? null - : objc.NSData.castFromPointer(arg4, retain: false, release: true), + : objc.NSData.fromPointer(arg4, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) => fn( arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer( + NSURLSession.fromPointer(arg1, retain: false, release: true), + NSURLSessionWebSocketTask.fromPointer( arg2, retain: false, release: true, @@ -88586,7 +88462,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke arg3, arg4.address == 0 ? null - : objc.NSData.castFromPointer(arg4, retain: false, release: true), + : objc.NSData.fromPointer(arg4, retain: false, release: true), ), keepIsolateAlive, ); @@ -88607,10 +88483,193 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocke ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + NSInteger arg3, + ffi.Pointer arg4, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ) + >()(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ))(arg0, arg1, arg2, arg3, arg4); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData$CallExtension on objc.ObjCBlock< ffi.Void Function( @@ -88634,10 +88693,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURL ffi.Void Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, NSInteger arg3, - ffi.Pointer arg4, + ffi.Pointer arg4, ) > >() @@ -88645,10 +88704,10 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURL void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -88661,38 +88720,577 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURL } /// NSURLSessionWebSocketDelegate -interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase - implements NSURLSessionTaskDelegate { - NSURLSessionWebSocketDelegate._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSURLSessionWebSocketDelegate._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, NSURLSessionTaskDelegate { /// Constructs a [NSURLSessionWebSocketDelegate] that points to the same underlying object as [other]. - NSURLSessionWebSocketDelegate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSURLSessionWebSocketDelegate.as(objc.ObjCObject other) : object$ = other; /// Constructs a [NSURLSessionWebSocketDelegate] that wraps the given raw object pointer. - NSURLSessionWebSocketDelegate.castFromPointer( - ffi.Pointer other, { + NSURLSessionWebSocketDelegate.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); /// Returns whether [obj] is an instance of [NSURLSessionWebSocketDelegate]. - static bool conformsTo(objc.ObjCObjectBase obj) { + static bool conformsTo(objc.ObjCObject obj) { return _objc_msgSend_e3qsqz( obj.ref.pointer, _sel_conformsToProtocol_, _protocol_NSURLSessionWebSocketDelegate, ); } +} + +extension NSURLSessionWebSocketDelegate$Methods + on NSURLSessionWebSocketDelegate { + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + void URLSession$5( + NSURLSession session, { + objc.NSError? didBecomeInvalidWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:didBecomeInvalidWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:didBecomeInvalidWithError:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didBecomeInvalidWithError_, + session.ref.pointer, + didBecomeInvalidWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + void URLSession$6( + NSURLSession session, { + required NSURLSessionTask didCreateTask, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:didCreateTask:', + iOS: (false, (16, 0, 0)), + macOS: (false, (13, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:didCreateTask:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_didCreateTask_, + session.ref.pointer, + didCreateTask.ref.pointer, + ); + } + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + void URLSession$7( + NSURLSession session, { + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_didReceiveChallenge_completionHandler_, + session.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + void URLSession$8( + NSURLSession session, { + required NSURLSessionTask task, + objc.NSError? didCompleteWithError, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:didCompleteWithError:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:didCompleteWithError:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didCompleteWithError_, + session.ref.pointer, + task.ref.pointer, + didCompleteWithError?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Sent when complete statistics information has been collected for the task. + void URLSession$9( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLSessionTaskMetrics didFinishCollectingMetrics, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:didFinishCollectingMetrics:', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 12, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:didFinishCollectingMetrics:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didFinishCollectingMetrics_, + session.ref.pointer, + task.ref.pointer, + didFinishCollectingMetrics.ref.pointer, + ); + } + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + void URLSession$10( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLAuthenticationChallenge didReceiveChallenge, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:didReceiveChallenge:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:didReceiveChallenge:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + session.ref.pointer, + task.ref.pointer, + didReceiveChallenge.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent for each informational response received except 101 switching protocols. + void URLSession$11( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse didReceiveInformationalResponse, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:didReceiveInformationalResponse:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:didReceiveInformationalResponse:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_task_didReceiveInformationalResponse_, + session.ref.pointer, + task.ref.pointer, + didReceiveInformationalResponse.ref.pointer, + ); + } + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + void URLSession$12( + NSURLSession session, { + required NSURLSessionTask task, + required int didSendBodyData, + required int totalBytesSent, + required int totalBytesExpectedToSend, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:', + ); + } + _objc_msgSend_1modw1b( + object$.ref.pointer, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + session.ref.pointer, + task.ref.pointer, + didSendBodyData, + totalBytesSent, + totalBytesExpectedToSend, + ); + } + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + void URLSession$13( + NSURLSession session, { + required NSURLSessionTask task, + required objc.ObjCBlock + needNewBodyStream, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:needNewBodyStream:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:needNewBodyStream:', + ); + } + _objc_msgSend_18qun1e( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStream_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStream.ref.pointer, + ); + } + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + void URLSession$14( + NSURLSession session, { + required NSURLSessionTask task, + required int needNewBodyStreamFromOffset, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + iOS: (false, (17, 0, 0)), + macOS: (false, (14, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:needNewBodyStreamFromOffset:completionHandler:', + ); + } + _objc_msgSend_9cddqw( + object$.ref.pointer, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + session.ref.pointer, + task.ref.pointer, + needNewBodyStreamFromOffset, + completionHandler.ref.pointer, + ); + } + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + void URLSession$15( + NSURLSession session, { + required NSURLSessionTask task, + required NSURLRequest willBeginDelayedRequest, + required objc.ObjCBlock + completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:willBeginDelayedRequest:completionHandler:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:willBeginDelayedRequest:completionHandler:', + ); + } + _objc_msgSend_m7tls4( + object$.ref.pointer, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willBeginDelayedRequest.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + void URLSession$16( + NSURLSession session, { + required NSURLSessionTask task, + required NSHTTPURLResponse willPerformHTTPRedirection, + required NSURLRequest newRequest, + required objc.ObjCBlock completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:', + ); + } + _objc_msgSend_e1wgee( + object$.ref.pointer, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + session.ref.pointer, + task.ref.pointer, + willPerformHTTPRedirection.ref.pointer, + newRequest.ref.pointer, + completionHandler.ref.pointer, + ); + } + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + void URLSession$17( + NSURLSession session, { + required NSURLSessionTask taskIsWaitingForConnectivity, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:taskIsWaitingForConnectivity:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:taskIsWaitingForConnectivity:', + ); + } + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URLSession_taskIsWaitingForConnectivity_, + session.ref.pointer, + taskIsWaitingForConnectivity.ref.pointer, + ); + } + + /// Indicates that the WebSocket has received a close frame from the server endpoint. + /// The close code and the close reason may be provided by the delegate if the server elects to send + /// this information in the close frame + void URLSession( + NSURLSession session, { + required NSURLSessionWebSocketTask webSocketTask, + required DartNSInteger didCloseWithCode, + objc.NSData? reason, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:webSocketTask:didCloseWithCode:reason:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:webSocketTask:didCloseWithCode:reason:', + ); + } + _objc_msgSend_d9bpjb( + object$.ref.pointer, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + session.ref.pointer, + webSocketTask.ref.pointer, + didCloseWithCode, + reason?.ref.pointer ?? ffi.nullptr, + ); + } + + /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. + /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. + void URLSession$1( + NSURLSession session, { + required NSURLSessionWebSocketTask webSocketTask, + objc.NSString? didOpenWithProtocol, + }) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSession:webSocketTask:didOpenWithProtocol:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSession:webSocketTask:didOpenWithProtocol:', + ); + } + _objc_msgSend_r8gdi7( + object$.ref.pointer, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + session.ref.pointer, + webSocketTask.ref.pointer, + didOpenWithProtocol?.ref.pointer ?? ffi.nullptr, + ); + } + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + void URLSessionDidFinishEventsForBackgroundURLSession(NSURLSession session) { + objc.checkOsVersionInternal( + 'NSURLSessionWebSocketDelegate.URLSessionDidFinishEventsForBackgroundURLSession:', + iOS: (false, (7, 0, 0)), + macOS: (false, (11, 0, 0)), + ); + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURLSessionWebSocketDelegate', + 'URLSessionDidFinishEventsForBackgroundURLSession:', + ); + } + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + session.ref.pointer, + ); + } +} +interface class NSURLSessionWebSocketDelegate$Builder { /// Returns the [objc.Protocol] object for this protocol. - static objc.Protocol get $protocol => objc.Protocol.castFromPointer( - _protocol_NSURLSessionWebSocketDelegate.cast(), - ); + static objc.Protocol get $protocol => + objc.Protocol.fromPointer(_protocol_NSURLSessionWebSocketDelegate.cast()); /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. @@ -88700,33 +89298,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionWebSocketDelegate implement({ - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -88734,6 +89318,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -88747,22 +89335,32 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -88770,86 +89368,87 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionWebSocketDelegate', ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implement( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + NSURLSessionWebSocketDelegate$Builder.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionWebSocketDelegate.castFrom( + return NSURLSessionWebSocketDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -88860,33 +89459,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilder( objc.ObjCProtocolBuilder builder, { - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -88894,6 +89479,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -88907,100 +89496,111 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implement( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implement( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + NSURLSessionWebSocketDelegate$Builder.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implement( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implement( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implement( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implement( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implement( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implement( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implement( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implement( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implement( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implement( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implement( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implement( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implement( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implement( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -89015,33 +89615,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionWebSocketDelegate implementAsListener({ - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -89049,6 +89635,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -89062,22 +89652,32 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -89085,87 +89685,88 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionWebSocketDelegate', ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implementAsListener( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStream_.implementAsListener( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionWebSocketDelegate.castFrom( + return NSURLSessionWebSocketDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -89177,33 +89778,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsListener( objc.ObjCProtocolBuilder builder, { - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -89211,6 +89798,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -89224,101 +89815,112 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implementAsListener( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsListener( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsListener( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsListener( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStream_.implementAsListener( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsListener( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsListener( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsListener( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsListener( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsListener( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsListener( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implementAsListener( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -89333,33 +89935,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. static NSURLSessionWebSocketDelegate implementAsBlocking({ - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -89367,6 +89955,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -89380,22 +89972,32 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, @@ -89403,87 +90005,88 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase final builder = objc.ObjCProtocolBuilder( debugName: 'NSURLSessionWebSocketDelegate', ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implementAsBlocking( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, ); builder.addProtocol($protocol); - return NSURLSessionWebSocketDelegate.castFrom( + return NSURLSessionWebSocketDelegate.as( builder.build(keepIsolateAlive: $keepIsolateAlive), ); } @@ -89495,33 +90098,19 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase /// Note: You cannot call this method after you have called `builder.build`. static void addToBuilderAsBlocking( objc.ObjCProtocolBuilder builder, { - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function( - NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, - )? - URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function( NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - )? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, + NSURLAuthenticationChallenge, + objc.ObjCBlock, )? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? + URLSession_task_didCompleteWithError_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? + URLSession_task_didFinishCollectingMetrics_, void Function( NSURLSession, NSURLSessionTask, @@ -89529,6 +90118,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? + URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function( NSURLSession, NSURLSessionTask, @@ -89542,101 +90135,112 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase objc.ObjCBlock, )? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? - URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? - URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? - URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, void Function( NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, )? - URLSession_didReceiveChallenge_completionHandler_, + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + )? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + )? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_, bool $keepIsolateAlive = true, }) { - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didOpenWithProtocol_.implementAsBlocking( - builder, - URLSession_webSocketTask_didOpenWithProtocol_, - ); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didBecomeInvalidWithError_.implementAsBlocking( builder, - URLSession_webSocketTask_didCloseWithCode_reason_, + URLSession_didBecomeInvalidWithError_, ); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didCreateTask_.implementAsBlocking( builder, URLSession_didCreateTask_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, - URLSession_task_willBeginDelayedRequest_completionHandler_, + URLSession_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didCompleteWithError_.implementAsBlocking( builder, - URLSession_taskIsWaitingForConnectivity_, + URLSession_task_didCompleteWithError_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + URLSession_task_didFinishCollectingMetrics_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_didReceiveChallenge_completionHandler_.implementAsBlocking( builder, URLSession_task_didReceiveChallenge_completionHandler_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + builder, + URLSession_task_didReceiveInformationalResponse_, + ); + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( + builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + ); + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStream_.implementAsBlocking( builder, URLSession_task_needNewBodyStream_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSession_task_needNewBodyStreamFromOffset_completionHandler_.implementAsBlocking( builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_.implementAsBlocking( - builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willBeginDelayedRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didReceiveInformationalResponse_, + URLSession_task_willBeginDelayedRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didFinishCollectingMetrics_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_.implementAsBlocking( builder, - URLSession_task_didFinishCollectingMetrics_, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ); - NSURLSessionWebSocketDelegate - .URLSession_task_didCompleteWithError_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_taskIsWaitingForConnectivity_.implementAsBlocking( builder, - URLSession_task_didCompleteWithError_, + URLSession_taskIsWaitingForConnectivity_, ); - NSURLSessionWebSocketDelegate - .URLSession_didBecomeInvalidWithError_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didCloseWithCode_reason_.implementAsBlocking( builder, - URLSession_didBecomeInvalidWithError_, + URLSession_webSocketTask_didCloseWithCode_reason_, ); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_.implementAsBlocking( + NSURLSessionWebSocketDelegate$Builder + .URLSession_webSocketTask_didOpenWithProtocol_.implementAsBlocking( builder, - URLSession_didReceiveChallenge_completionHandler_, + URLSession_webSocketTask_didOpenWithProtocol_, ); - NSURLSessionWebSocketDelegate + NSURLSessionWebSocketDelegate$Builder .URLSessionDidFinishEventsForBackgroundURLSession_.implementAsBlocking( builder, URLSessionDidFinishEventsForBackgroundURLSession_, @@ -89644,572 +90248,532 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase builder.addProtocol($protocol); } - /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. - /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. - static final URLSession_webSocketTask_didOpenWithProtocol_ = + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) + void Function(NSURLSession, objc.NSError?) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didOpenWithProtocol_, + _sel_URLSession_didBecomeInvalidWithError_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didOpenWithProtocol_, + _sel_URLSession_didBecomeInvalidWithError_, isRequired: false, isInstanceMethod: true, ), - ( - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.fromFunction( + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - objc.NSString? arg3, - ) => func(arg1, arg2, arg3), + objc.NSError? arg2, + ) => func(arg1, arg2), ), - ( - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.listener( + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - objc.NSString? arg3, - ) => func(arg1, arg2, arg3), + objc.NSError? arg2, + ) => func(arg1, arg2), ), - ( - void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.blocking( + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - objc.NSString? arg3, - ) => func(arg1, arg2, arg3), + objc.NSError? arg2, + ) => func(arg1, arg2), ), ); - /// Indicates that the WebSocket has received a close frame from the server endpoint. - /// The close code and the close reason may be provided by the delegate if the server elects to send - /// this information in the close frame - static final URLSession_webSocketTask_didCloseWithCode_reason_ = + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask) + >( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didCreateTask_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + .cast(), + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + ( + ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + ) => func(arg1, arg2), + ), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = objc.ObjCProtocolListenableMethod< void Function( NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + _sel_URLSession_didReceiveChallenge_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1lx650f) + >(_NativeCupertinoHttp_protocolTrampoline_bklti2) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + _sel_URLSession_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( void Function( NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ( void Function( NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ( void Function( NSURLSession, - NSURLSessionWebSocketTask, - DartNSInteger, - objc.NSData?, + NSURLAuthenticationChallenge, + objc.ObjCBlock, ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3, + ) => func(arg1, arg2, arg3), ), ); - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask) + void Function(NSURLSession, NSURLSessionTask, objc.NSError?) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didCreateTask_, + _sel_URLSession_task_didCompleteWithError_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didCreateTask_, + _sel_URLSession_task_didCompleteWithError_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + objc.NSError? arg3, + ) => func(arg1, arg2, arg3), ), ); - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_xx612k) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + _sel_URLSession_task_didFinishCollectingMetrics_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + NSURLSessionTaskMetrics arg3, + ) => func(arg1, arg2, arg3), ), ); - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask) + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + >(_NativeCupertinoHttp_protocolTrampoline_xx612k) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + ( + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + ( + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( + ( + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - ) => func(arg1, arg2), + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ); - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didReceiveInformationalResponse_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + _sel_URLSession_task_didReceiveInformationalResponse_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) - func, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) - func, + NSHTTPURLResponse arg3, + ) => func(arg1, arg2, arg3), + ), + ( + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock, - ) - func, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), + ) => func(arg1, arg2, arg3), ), ); - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionTask, int, int, int) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64, ) > - >(_NativeCupertinoHttp_protocolTrampoline_xx612k) + >(_NativeCupertinoHttp_protocolTrampoline_h68abb) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, isRequired: false, isInstanceMethod: true, ), - ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), - ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), - ( - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) - func, - ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock - arg4, - ) => func(arg1, arg2, arg3, arg4), + int arg3, + int arg4, + int arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ); @@ -90229,10 +90793,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -90315,10 +90879,10 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Int64, ffi.Pointer, ) @@ -90387,384 +90951,424 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase ), ); - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int) - >( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - ffi.Native.addressOf< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64, - ) - > - >(_NativeCupertinoHttp_protocolTrampoline_h68abb) - .cast(), - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.fromFunction( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.listener( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64.blocking( - ( - ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - int arg4, - int arg5, - ) => func(arg1, arg2, arg3, arg4, arg5), - ), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_xx612k) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ( - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock, + ) + func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - ) => func(arg1, arg2, arg3), + NSURLRequest arg3, + objc.ObjCBlock + arg4, + ) => func(arg1, arg2, arg3, arg4), ), ); - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_l2g8ke) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, isRequired: false, isInstanceMethod: true, ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ( - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + void Function( + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock, + ) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - NSURLSessionTaskMetrics arg3, - ) => func(arg1, arg2, arg3), + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5, + ) => func(arg1, arg2, arg3, arg4, arg5), ), ); - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?) + void Function(NSURLSession, NSURLSessionTask) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didCompleteWithError_, + _sel_URLSession_taskIsWaitingForConnectivity_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) + >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didCompleteWithError_, + _sel_URLSession_taskIsWaitingForConnectivity_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.fromFunction( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), + ) => func(arg1, arg2), ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.listener( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), + ) => func(arg1, arg2), ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError.blocking( + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.blocking( ( ffi.Pointer _, NSURLSession arg1, NSURLSessionTask arg2, - objc.NSError? arg3, - ) => func(arg1, arg2, arg3), + ) => func(arg1, arg2), ), ); - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = + /// Indicates that the WebSocket has received a close frame from the server endpoint. + /// The close code and the close reason may be provided by the delegate if the server elects to send + /// this information in the close frame + static final URLSession_webSocketTask_didCloseWithCode_reason_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, objc.NSError?) + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + ) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didBecomeInvalidWithError_, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_fjrv01) + >(_NativeCupertinoHttp_protocolTrampoline_1lx650f) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didBecomeInvalidWithError_, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + ( + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4, + ) => func(arg1, arg2, arg3, arg4), ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + ( + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.listener( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4, + ) => func(arg1, arg2, arg3, arg4), ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.blocking( + ( + void Function( + NSURLSession, + NSURLSessionWebSocketTask, + DartNSInteger, + objc.NSData?, + ) + func, + ) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData.blocking( ( ffi.Pointer _, NSURLSession arg1, - objc.NSError? arg2, - ) => func(arg1, arg2), + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4, + ) => func(arg1, arg2, arg3, arg4), ), ); - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = + /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. + /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. + static final URLSession_webSocketTask_didOpenWithProtocol_ = objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) >( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - >(_NativeCupertinoHttp_protocolTrampoline_bklti2) + >(_NativeCupertinoHttp_protocolTrampoline_1tz5yf) .cast(), objc.getProtocolMethodSignature( _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, isRequired: false, isInstanceMethod: true, ), ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.fromFunction( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.fromFunction( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, + NSURLSessionWebSocketTask arg2, + objc.NSString? arg3, ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.listener( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.listener( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, + NSURLSessionWebSocketTask arg2, + objc.NSString? arg3, ) => func(arg1, arg2, arg3), ), ( - void Function( - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock, - ) + void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) func, ) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential.blocking( + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString.blocking( ( ffi.Pointer _, NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3, + NSURLSessionWebSocketTask arg2, + objc.NSString? arg3, ) => func(arg1, arg2, arg3), ), ); @@ -90783,9 +91387,9 @@ interface class NSURLSessionWebSocketDelegate extends objc.ObjCProtocolBase ffi.Native.addressOf< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >(_NativeCupertinoHttp_protocolTrampoline_18v1jvf) @@ -90820,8 +91424,8 @@ late final _sel_valueWithBytes_objCType_ = objc.registerName( final _objc_msgSend_e9mncn = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -90829,8 +91433,8 @@ final _objc_msgSend_e9mncn = objc.msgSendPointer > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -90840,32 +91444,32 @@ late final _sel_value_withObjCType_ = objc.registerName("value:withObjCType:"); /// NSValueCreation extension NSValueCreation on objc.NSValue { - /// valueWithBytes:objCType: - static objc.NSValue valueWithBytes( + /// value:withObjCType: + static objc.NSValue value( ffi.Pointer value, { - required ffi.Pointer objCType, + required ffi.Pointer withObjCType, }) { - final _ret = _objc_msgSend_e9mncn( + final $ret = _objc_msgSend_e9mncn( _class_NSValue, - _sel_valueWithBytes_objCType_, + _sel_value_withObjCType_, value, - objCType, + withObjCType, ); - return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + return objc.NSValue.fromPointer($ret, retain: true, release: true); } - /// value:withObjCType: - static objc.NSValue value( - ffi.Pointer value$1, { - required ffi.Pointer withObjCType, + /// valueWithBytes:objCType: + static objc.NSValue valueWithBytes( + ffi.Pointer value, { + required ffi.Pointer objCType, }) { - final _ret = _objc_msgSend_e9mncn( + final $ret = _objc_msgSend_e9mncn( _class_NSValue, - _sel_value_withObjCType_, - value$1, - withObjCType, + _sel_valueWithBytes_objCType_, + value, + objCType, ); - return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + return objc.NSValue.fromPointer($ret, retain: true, release: true); } } @@ -90879,16 +91483,16 @@ late final _sel_valueWithPointer_ = objc.registerName("valueWithPointer:"); final _objc_msgSend_1mbt9g9 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -90898,14 +91502,14 @@ final _objc_msgSend_6ex6p5 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -90913,51 +91517,49 @@ late final _sel_isEqualToValue_ = objc.registerName("isEqualToValue:"); /// NSValueExtensionMethods extension NSValueExtensionMethods on objc.NSValue { - /// valueWithNonretainedObject: - static objc.NSValue valueWithNonretainedObject( - objc.ObjCObjectBase? anObject, - ) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSValue, - _sel_valueWithNonretainedObject_, - anObject?.ref.pointer ?? ffi.nullptr, + /// isEqualToValue: + bool isEqualToValue(objc.NSValue value) { + return _objc_msgSend_19nvye5( + object$.ref.pointer, + _sel_isEqualToValue_, + value.ref.pointer, ); - return objc.NSValue.castFromPointer(_ret, retain: true, release: true); } /// nonretainedObjectValue - objc.ObjCObjectBase? get nonretainedObjectValue { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + objc.ObjCObject? get nonretainedObjectValue { + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_nonretainedObjectValue, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// valueWithPointer: - static objc.NSValue valueWithPointer(ffi.Pointer pointer$1) { - final _ret = _objc_msgSend_1mbt9g9( - _class_NSValue, - _sel_valueWithPointer_, - pointer$1, - ); - return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } /// pointerValue ffi.Pointer get pointerValue { - return _objc_msgSend_6ex6p5(this.ref.pointer, _sel_pointerValue); + return _objc_msgSend_6ex6p5(object$.ref.pointer, _sel_pointerValue); } - /// isEqualToValue: - bool isEqualToValue(objc.NSValue value) { - return _objc_msgSend_19nvye5( - this.ref.pointer, - _sel_isEqualToValue_, - value.ref.pointer, + /// valueWithNonretainedObject: + static objc.NSValue valueWithNonretainedObject(objc.ObjCObject? anObject) { + final $ret = _objc_msgSend_1sotr3r( + _class_NSValue, + _sel_valueWithNonretainedObject_, + anObject?.ref.pointer ?? ffi.nullptr, ); + return objc.NSValue.fromPointer($ret, retain: true, release: true); + } + + /// valueWithPointer: + static objc.NSValue valueWithPointer(ffi.Pointer pointer) { + final $ret = _objc_msgSend_1mbt9g9( + _class_NSValue, + _sel_valueWithPointer_, + pointer, + ); + return objc.NSValue.fromPointer($ret, retain: true, release: true); } } @@ -90966,7 +91568,7 @@ final _objc_msgSend_ovsamd = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -90974,7 +91576,7 @@ final _objc_msgSend_ovsamd = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -90983,13 +91585,13 @@ final _objc_msgSend_ovsamd = objc.msgSendPointer /// NSDeprecated extension NSDeprecated$2 on objc.NSValue { /// getValue: - void getValue(ffi.Pointer value) { + void getValue$1(ffi.Pointer value) { objc.checkOsVersionInternal( 'NSValue.getValue:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - _objc_msgSend_ovsamd(this.ref.pointer, _sel_getValue_, value); + _objc_msgSend_ovsamd(object$.ref.pointer, _sel_getValue_, value); } } @@ -90999,16 +91601,16 @@ late final _sel_valueWithRange_ = objc.registerName("valueWithRange:"); final _objc_msgSend_1k1o1s7 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, objc.NSRange, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, objc.NSRange, ) @@ -91018,14 +91620,14 @@ final _objc_msgSend_1u11dbb = objc.msgSendPointer .cast< ffi.NativeFunction< objc.NSRange Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< objc.NSRange Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -91034,7 +91636,7 @@ final _objc_msgSend_1u11dbbStret = objc.msgSendStretPointer ffi.NativeFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > @@ -91042,34 +91644,37 @@ final _objc_msgSend_1u11dbbStret = objc.msgSendStretPointer .asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); /// NSValueRangeExtensions extension NSValueRangeExtensions on objc.NSValue { - /// valueWithRange: - static objc.NSValue valueWithRange(NSRange range) { - final _ret = _objc_msgSend_1k1o1s7( - _class_NSValue, - _sel_valueWithRange_, - range, - ); - return objc.NSValue.castFromPointer(_ret, retain: true, release: true); - } - /// rangeValue NSRange get rangeValue { - final _ptr = pkg_ffi.calloc(); + final $ptr = pkg_ffi.calloc(); objc.useMsgSendVariants - ? _objc_msgSend_1u11dbbStret(_ptr, this.ref.pointer, _sel_rangeValue) - : _ptr.ref = _objc_msgSend_1u11dbb(this.ref.pointer, _sel_rangeValue); - final _finalizable = _ptr.cast().asTypedList( + ? _objc_msgSend_1u11dbbStret($ptr, object$.ref.pointer, _sel_rangeValue) + : $ptr.ref = _objc_msgSend_1u11dbb( + object$.ref.pointer, + _sel_rangeValue, + ); + final $finalizable = $ptr.cast().asTypedList( ffi.sizeOf(), finalizer: pkg_ffi.calloc.nativeFree, ); - return ffi.Struct.create(_finalizable); + return ffi.Struct.create($finalizable); + } + + /// valueWithRange: + static objc.NSValue valueWithRange(NSRange range) { + final $ret = _objc_msgSend_1k1o1s7( + _class_NSValue, + _sel_valueWithRange_, + range, + ); + return objc.NSValue.fromPointer($ret, retain: true, release: true); } } @@ -91082,19 +91687,19 @@ late final _sel_arrayWithObjects_count_ = objc.registerName( final _objc_msgSend_zmbtbd = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ffi.UnsignedLong, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, int, ) >(); @@ -91111,201 +91716,154 @@ late final _sel_arrayWithContentsOfURL_error_ = objc.registerName( /// NSArrayCreation extension NSArrayCreation on objc.NSArray { - /// array - static objc.NSArray array() { - final _ret = _objc_msgSend_151sglz(_class_NSArray, _sel_array); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithObject: - static objc.NSArray arrayWithObject(objc.ObjCObjectBase anObject) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, - _sel_arrayWithObject_, - anObject.ref.pointer, - ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithObjects:count: - static objc.NSArray arrayWithObjects( - ffi.Pointer> objects, { - required DartNSUInteger count, - }) { - final _ret = _objc_msgSend_zmbtbd( - _class_NSArray, - _sel_arrayWithObjects_count_, - objects, - count, + /// initWithArray: + objc.NSArray initWithArray(objc.NSArray array) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithArray_, + array.ref.pointer, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: false, release: true); } - /// arrayWithObjects: - static objc.NSArray arrayWithObjects$1(objc.ObjCObjectBase firstObj) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, - _sel_arrayWithObjects_, - firstObj.ref.pointer, + /// initWithArray:copyItems: + objc.NSArray initWithArray$1(objc.NSArray array, {required bool copyItems}) { + final $ret = _objc_msgSend_17amj0z( + object$.ref.retainAndReturnPointer(), + _sel_initWithArray_copyItems_, + array.ref.pointer, + copyItems, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: false, release: true); } - /// arrayWithArray: - static objc.NSArray arrayWithArray(objc.NSArray array$1) { - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, - _sel_arrayWithArray_, - array$1.ref.pointer, + /// initWithContentsOfURL:error: + objc.NSArray? initWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSArray.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, + url.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: false, release: true); + } finally { + pkg_ffi.calloc.free($err); + } } /// initWithObjects: - objc.NSArray initWithObjects(objc.ObjCObjectBase firstObj) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + objc.NSArray initWithObjects$1(objc.ObjCObject firstObj) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithObjects_, firstObj.ref.pointer, ); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + return objc.NSArray.fromPointer($ret, retain: false, release: true); } - /// initWithArray: - objc.NSArray initWithArray(objc.NSArray array$1) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithArray_, - array$1.ref.pointer, - ); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + /// array + static objc.NSArray array() { + final $ret = _objc_msgSend_151sglz(_class_NSArray, _sel_array); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// initWithArray:copyItems: - objc.NSArray initWithArray$1( - objc.NSArray array$1, { - required bool copyItems, - }) { - final _ret = _objc_msgSend_17amj0z( - this.ref.retainAndReturnPointer(), - _sel_initWithArray_copyItems_, - array$1.ref.pointer, - copyItems, + /// arrayWithArray: + static objc.NSArray arrayWithArray(objc.NSArray array) { + final $ret = _objc_msgSend_1sotr3r( + _class_NSArray, + _sel_arrayWithArray_, + array.ref.pointer, ); - return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// initWithContentsOfURL:error: - objc.NSArray? initWithContentsOfURL( - objc.NSURL url, { - required ffi.Pointer> error, - }) { + /// arrayWithContentsOfURL:error: + static objc.NSArray? arrayWithContentsOfURL(objc.NSURL url) { objc.checkOsVersionInternal( - 'NSArray.initWithContentsOfURL:error:', + 'NSArray.arrayWithContentsOfURL:error:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_1lhpu4m( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_error_, - url.ref.pointer, - error, + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _class_NSArray, + _sel_arrayWithContentsOfURL_error_, + url.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } + + /// arrayWithObject: + static objc.NSArray arrayWithObject(objc.ObjCObject anObject) { + final $ret = _objc_msgSend_1sotr3r( + _class_NSArray, + _sel_arrayWithObject_, + anObject.ref.pointer, ); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// arrayWithContentsOfURL:error: - static objc.NSArray? arrayWithContentsOfURL( - objc.NSURL url, { - required ffi.Pointer> error, - }) { - objc.checkOsVersionInternal( - 'NSArray.arrayWithContentsOfURL:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), + /// arrayWithObjects: + static objc.NSArray arrayWithObjects(objc.ObjCObject firstObj) { + final $ret = _objc_msgSend_1sotr3r( + _class_NSArray, + _sel_arrayWithObjects_, + firstObj.ref.pointer, ); - final _ret = _objc_msgSend_1lhpu4m( + return objc.NSArray.fromPointer($ret, retain: true, release: true); + } + + /// arrayWithObjects:count: + static objc.NSArray arrayWithObjects$1( + ffi.Pointer> objects, { + required DartNSUInteger count, + }) { + final $ret = _objc_msgSend_zmbtbd( _class_NSArray, - _sel_arrayWithContentsOfURL_error_, - url.ref.pointer, - error, + _sel_arrayWithObjects_count_, + objects, + count, ); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } } -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - bool Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as bool Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline, - false, - ) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObjectImpl_objcObjCObjectImpl { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >(pointer, retain: retain, release: release); @@ -91316,16 +91874,16 @@ abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { /// will result in a crash. static objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > > @@ -91333,14 +91891,11 @@ abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { ) => objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >( - objc.newPointerBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -91355,46 +91910,94 @@ abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > fromFunction( - bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn, { + bool Function(objc.ObjCObject, objc.ObjCObject) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >( objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.ObjCObject(arg0, retain: true, release: true), + objc.ObjCObject(arg1, retain: true, release: true), ), keepIsolateAlive, ), retain: false, release: true, ); + + static bool _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline, false) + .cast(); + static bool _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as bool Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline, false) + .cast(); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_bool_objcObjCObject_objcObjCObject_CallExtension +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObjectImpl_objcObjCObjectImpl$CallExtension on objc.ObjCBlock< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > { - bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => ref + bool call(objc.ObjCObject arg0, objc.ObjCObject arg1) => ref .pointer .ref .invoke @@ -91402,16 +92005,16 @@ extension ObjCBlock_bool_objcObjCObject_objcObjCObject_CallExtension ffi.NativeFunction< ffi.Bool Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > >() .asFunction< bool Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } @@ -91421,20 +92024,20 @@ late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_ = objc final _objc_msgSend_1415lvo = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, ) @@ -91445,19 +92048,19 @@ late final _sel_differenceFromArray_withOptions_ = objc.registerName( final _objc_msgSend_1wtpmu7 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, NSUInteger, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ) >(); @@ -91470,32 +92073,39 @@ late final _sel_arrayByApplyingDifference_ = objc.registerName( /// NSArrayDiffing extension NSArrayDiffing on objc.NSArray { - /// differenceFromArray:withOptions:usingEquivalenceTest: - objc.NSOrderedCollectionDifference differenceFromArray( - objc.NSArray other, { - required objc.NSOrderedCollectionDifferenceCalculationOptions withOptions, - required objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ) - > - usingEquivalenceTest, - }) { + /// arrayByApplyingDifference: + objc.NSArray? arrayByApplyingDifference( + objc.NSOrderedCollectionDifference difference, + ) { objc.checkOsVersionInternal( - 'NSArray.differenceFromArray:withOptions:usingEquivalenceTest:', + 'NSArray.arrayByApplyingDifference:', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1415lvo( - this.ref.pointer, - _sel_differenceFromArray_withOptions_usingEquivalenceTest_, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_arrayByApplyingDifference_, + difference.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); + } + + /// differenceFromArray: + objc.NSOrderedCollectionDifference differenceFromArray(objc.NSArray other) { + objc.checkOsVersionInternal( + 'NSArray.differenceFromArray:', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_differenceFromArray_, other.ref.pointer, - withOptions.value, - usingEquivalenceTest.ref.pointer, ); - return objc.NSOrderedCollectionDifference.castFromPointer( - _ret, + return objc.NSOrderedCollectionDifference.fromPointer( + $ret, retain: true, release: true, ); @@ -91511,56 +92121,49 @@ extension NSArrayDiffing on objc.NSArray { iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1wtpmu7( - this.ref.pointer, + final $ret = _objc_msgSend_1wtpmu7( + object$.ref.pointer, _sel_differenceFromArray_withOptions_, other.ref.pointer, - withOptions.value, + withOptions, ); - return objc.NSOrderedCollectionDifference.castFromPointer( - _ret, + return objc.NSOrderedCollectionDifference.fromPointer( + $ret, retain: true, release: true, ); } - /// differenceFromArray: - objc.NSOrderedCollectionDifference differenceFromArray$2(objc.NSArray other) { + /// differenceFromArray:withOptions:usingEquivalenceTest: + objc.NSOrderedCollectionDifference differenceFromArray$2( + objc.NSArray other, { + required objc.NSOrderedCollectionDifferenceCalculationOptions withOptions, + required objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ) + > + usingEquivalenceTest, + }) { objc.checkOsVersionInternal( - 'NSArray.differenceFromArray:', + 'NSArray.differenceFromArray:withOptions:usingEquivalenceTest:', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_differenceFromArray_, + final $ret = _objc_msgSend_1415lvo( + object$.ref.pointer, + _sel_differenceFromArray_withOptions_usingEquivalenceTest_, other.ref.pointer, + withOptions, + usingEquivalenceTest.ref.pointer, ); - return objc.NSOrderedCollectionDifference.castFromPointer( - _ret, + return objc.NSOrderedCollectionDifference.fromPointer( + $ret, retain: true, release: true, ); } - - /// arrayByApplyingDifference: - objc.NSArray? arrayByApplyingDifference( - objc.NSOrderedCollectionDifference difference, - ) { - objc.checkOsVersionInternal( - 'NSArray.arrayByApplyingDifference:', - iOS: (false, (13, 0, 0)), - macOS: (false, (10, 15, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_arrayByApplyingDifference_, - difference.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } } late final _sel_getObjects_ = objc.registerName("getObjects:"); @@ -91568,17 +92171,17 @@ final _objc_msgSend_1dau4w = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ) > >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ) >(); late final _sel_arrayWithContentsOfFile_ = objc.registerName( @@ -91589,49 +92192,15 @@ late final _sel_arrayWithContentsOfURL_ = objc.registerName( ); /// NSDeprecated -extension NSDeprecated$3 on objc.NSArray { +extension NSDeprecated$1 on objc.NSArray { /// getObjects: - void getObjects(ffi.Pointer> objects) { + void getObjects(ffi.Pointer> objects) { objc.checkOsVersionInternal( 'NSArray.getObjects:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - _objc_msgSend_1dau4w(this.ref.pointer, _sel_getObjects_, objects); - } - - /// arrayWithContentsOfFile: - static objc.NSArray? arrayWithContentsOfFile(objc.NSString path) { - objc.checkOsVersionInternal( - 'NSArray.arrayWithContentsOfFile:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, - _sel_arrayWithContentsOfFile_, - path.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// arrayWithContentsOfURL: - static objc.NSArray? arrayWithContentsOfURL(objc.NSURL url) { - objc.checkOsVersionInternal( - 'NSArray.arrayWithContentsOfURL:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSArray, - _sel_arrayWithContentsOfURL_, - url.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + _objc_msgSend_1dau4w(object$.ref.pointer, _sel_getObjects_, objects); } /// initWithContentsOfFile: @@ -91641,14 +92210,14 @@ extension NSDeprecated$3 on objc.NSArray { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithContentsOfFile_, path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + : objc.NSArray.fromPointer($ret, retain: false, release: true); } /// initWithContentsOfURL: @@ -91658,14 +92227,14 @@ extension NSDeprecated$3 on objc.NSArray { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_, url.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + : objc.NSArray.fromPointer($ret, retain: false, release: true); } /// writeToFile:atomically: @@ -91676,7 +92245,7 @@ extension NSDeprecated$3 on objc.NSArray { macOS: (false, (10, 0, 0)), ); return _objc_msgSend_1iyq28l( - this.ref.pointer, + object$.ref.pointer, _sel_writeToFile_atomically_, path.ref.pointer, atomically, @@ -91691,12 +92260,46 @@ extension NSDeprecated$3 on objc.NSArray { macOS: (false, (10, 0, 0)), ); return _objc_msgSend_1iyq28l( - this.ref.pointer, + object$.ref.pointer, _sel_writeToURL_atomically_, url.ref.pointer, atomically, ); } + + /// arrayWithContentsOfFile: + static objc.NSArray? arrayWithContentsOfFile(objc.NSString path) { + objc.checkOsVersionInternal( + 'NSArray.arrayWithContentsOfFile:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSArray, + _sel_arrayWithContentsOfFile_, + path.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); + } + + /// arrayWithContentsOfURL: + static objc.NSArray? arrayWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSArray.arrayWithContentsOfURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSArray, + _sel_arrayWithContentsOfURL_, + url.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); + } } late final _class_NSMutableArray = objc.getClass("NSMutableArray"); @@ -91704,82 +92307,62 @@ late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); /// NSMutableArrayCreation extension NSMutableArrayCreation on objc.NSMutableArray { + /// initWithContentsOfFile: + objc.NSMutableArray? initWithContentsOfFile(objc.NSString path) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, + path.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSMutableArray.fromPointer($ret, retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.NSMutableArray? initWithContentsOfURL(objc.NSURL url) { + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, + url.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.NSMutableArray.fromPointer($ret, retain: false, release: true); + } + /// arrayWithCapacity: static objc.NSMutableArray arrayWithCapacity(DartNSUInteger numItems) { - final _ret = _objc_msgSend_14hpxwa( + final $ret = _objc_msgSend_14hpxwa( _class_NSMutableArray, _sel_arrayWithCapacity_, numItems, ); - return objc.NSMutableArray.castFromPointer( - _ret, - retain: true, - release: true, - ); + return objc.NSMutableArray.fromPointer($ret, retain: true, release: true); } /// arrayWithContentsOfFile: static objc.NSMutableArray? arrayWithContentsOfFile(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSMutableArray.castFromPointer( - _ret, - retain: true, - release: true, - ); + : objc.NSMutableArray.fromPointer($ret, retain: true, release: true); } /// arrayWithContentsOfURL: static objc.NSMutableArray? arrayWithContentsOfURL(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r( + final $ret = _objc_msgSend_1sotr3r( _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSMutableArray.castFromPointer( - _ret, - retain: true, - release: true, - ); - } - - /// initWithContentsOfFile: - objc.NSMutableArray? initWithContentsOfFile(objc.NSString path) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, - path.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer( - _ret, - retain: false, - release: true, - ); - } - - /// initWithContentsOfURL: - objc.NSMutableArray? initWithContentsOfURL(objc.NSURL url) { - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, - url.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer( - _ret, - retain: false, - release: true, - ); + : objc.NSMutableArray.fromPointer($ret, retain: true, release: true); } } @@ -91795,159 +92378,26 @@ extension NSMutableArrayDiffing on objc.NSMutableArray { macOS: (false, (10, 15, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, + object$.ref.pointer, _sel_applyDifference_, difference.ref.pointer, ); } } -void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer -_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock?, objc.NSError)>`. +/// Construction methods for `objc.ObjCBlock?, objc.NSError)>`. abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -91956,26 +92406,23 @@ abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -91989,29 +92436,29 @@ abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > fromFunction( void Function(objc.NSSecureCoding?, objc.NSError) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( arg0.address == 0 ? null - : objc.NSSecureCoding.castFromPointer( + : objc.NSSecureCoding.fromPointer( arg0, retain: true, release: true, ), - objc.NSError.castFromPointer(arg1, retain: true, release: true), + objc.NSError.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -92029,33 +92476,33 @@ abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > listener( void Function(objc.NSSecureCoding?, objc.NSError) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSSecureCoding.castFromPointer( - arg0, - retain: false, - release: true, - ), - objc.NSError.castFromPointer(arg1, retain: false, release: true), - ), + _listenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => fn( + arg0.address == 0 + ? null + : objc.NSSecureCoding.fromPointer( + arg0, + retain: false, + release: true, + ), + objc.NSError.fromPointer(arg1, retain: false, release: true), + ), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapListenerBlock_pfv6jd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >(wrapper, retain: false, release: true); } @@ -92070,44 +92517,44 @@ abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > blocking( void Function(objc.NSSecureCoding?, objc.NSError) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSSecureCoding.castFromPointer( - arg0, - retain: false, - release: true, - ), - objc.NSError.castFromPointer(arg1, retain: false, release: true), - ), + _blockingCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => fn( + arg0.address == 0 + ? null + : objc.NSSecureCoding.fromPointer( + arg0, + retain: false, + release: true, + ), + objc.NSError.fromPointer(arg1, retain: false, release: true), + ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_idNSSecureCoding_NSError_blockingListenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSSecureCoding.castFromPointer( - arg0, - retain: false, - release: true, - ), - objc.NSError.castFromPointer(arg1, retain: false, release: true), - ), + _blockingListenerCallable.nativeFunction.cast(), + ( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => fn( + arg0.address == 0 + ? null + : objc.NSSecureCoding.fromPointer( + arg0, + retain: false, + release: true, + ), + objc.NSError.fromPointer(arg1, retain: false, release: true), + ), keepIsolateAlive, ); final wrapper = _NativeCupertinoHttp_wrapBlockingBlock_pfv6jd( @@ -92118,16 +92565,148 @@ abstract final class ObjCBlock_ffiVoid_idNSSecureCoding_NSError { objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -/// Call operator for `objc.ObjCBlock?, objc.NSError)>`. -extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError_CallExtension +/// Call operator for `objc.ObjCBlock?, objc.NSError)>`. +extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError$CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) > { void call(objc.NSSecureCoding? arg0, objc.NSError arg1) => ref .pointer @@ -92137,16 +92716,16 @@ extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError_CallExtension ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1.ref.pointer); } @@ -92154,186 +92733,22 @@ extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError_CallExtension typedef NSItemProviderCompletionHandler = ffi.Pointer; typedef DartNSItemProviderCompletionHandler = objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >; -void -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - void Function( - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as void Function( - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureTrampoline, - ) - .cast(); -void -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerTrampoline( - ffi.Pointer block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - (objc.getBlockClosure(block) - as void Function( - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerTrampoline, - ) - ..keepIsolateAlive = false; -void -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) { - try { - (objc.getBlockClosure(block) - as void Function( - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline, - ) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, - ) - >.listener( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingTrampoline, - ) - ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. -abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary { +/// Construction methods for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObjectImpl_NSDictionary { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -92341,9 +92756,9 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >(pointer, retain: retain, release: release); @@ -92356,9 +92771,9 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO static objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > @@ -92367,8 +92782,8 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO ffi.NativeFunction< ffi.Void Function( NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > > @@ -92377,16 +92792,13 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -92402,16 +92814,16 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO static objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > fromFunction( void Function( DartNSItemProviderCompletionHandler, - objc.ObjCObjectBase, + objc.ObjCObject, objc.NSDictionary, ) fn, { @@ -92420,30 +92832,26 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable, + _closureCallable, ( NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( - ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.fromPointer( arg0, retain: true, release: true, ), - objc.ObjCObjectBase(arg1, retain: true, release: true), - objc.NSDictionary.castFromPointer( - arg2, - retain: true, - release: true, - ), + objc.ObjCObject(arg1, retain: true, release: true), + objc.NSDictionary.fromPointer(arg2, retain: true, release: true), ), keepIsolateAlive, ), @@ -92463,37 +92871,35 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO static objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > listener( void Function( DartNSItemProviderCompletionHandler, - objc.ObjCObjectBase, + objc.ObjCObject, objc.NSDictionary, ) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable - .nativeFunction - .cast(), + _listenerCallable.nativeFunction.cast(), ( NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( - ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.fromPointer( arg0, retain: false, release: true, ), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, retain: false, release: true), + objc.ObjCObject(arg1, retain: false, release: true), + objc.NSDictionary.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -92502,9 +92908,9 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO return objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >(wrapper, retain: false, release: true); @@ -92523,56 +92929,52 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO static objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > blocking( void Function( DartNSItemProviderCompletionHandler, - objc.ObjCObjectBase, + objc.ObjCObject, objc.NSDictionary, ) fn, { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingCallable - .nativeFunction - .cast(), + _blockingCallable.nativeFunction.cast(), ( NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( - ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.fromPointer( arg0, retain: false, release: true, ), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, retain: false, release: true), + objc.ObjCObject(arg1, retain: false, release: true), + objc.NSDictionary.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_blockingListenerCallable - .nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) => fn( - ObjCBlock_ffiVoid_idNSSecureCoding_NSError.castFromPointer( + ObjCBlock_ffiVoid_idNSSecureCoding_NSError.fromPointer( arg0, retain: false, release: true, ), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.NSDictionary.castFromPointer(arg2, retain: false, release: true), + objc.ObjCObject(arg1, retain: false, release: true), + objc.NSDictionary.fromPointer(arg2, retain: false, release: true), ), keepIsolateAlive, ); @@ -92586,30 +92988,179 @@ abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCO return objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >(wrapper, retain: false, release: true); } + + static void _listenerTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + (objc.getBlockClosure(block) + as void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } -/// Call operator for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. -extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_CallExtension +/// Call operator for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObjectImpl_NSDictionary$CallExtension on objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) > { void call( DartNSItemProviderCompletionHandler arg0, - objc.ObjCObjectBase arg1, + objc.ObjCObject arg1, objc.NSDictionary arg2, ) => ref.pointer.ref.invoke .cast< @@ -92617,8 +93168,8 @@ extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDic ffi.Void Function( ffi.Pointer block, NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + ffi.Pointer arg1, + ffi.Pointer arg2, ) > >() @@ -92626,8 +93177,8 @@ extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDic void Function( ffi.Pointer, NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); } @@ -92637,9 +93188,9 @@ typedef DartNSItemProviderLoadHandler = objc.ObjCBlock< ffi.Void Function( objc.ObjCBlock< - ffi.Void Function(ffi.Pointer?, objc.NSError) + ffi.Void Function(ffi.Pointer?, objc.NSError) >, - ffi.Pointer, + ffi.Pointer, objc.NSDictionary, ) >; @@ -92649,14 +93200,14 @@ final _objc_msgSend_uwvaik = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -92667,7 +93218,25 @@ late final _sel_loadPreviewImageWithOptions_completionHandler_ = objc .registerName("loadPreviewImageWithOptions:completionHandler:"); /// NSPreviewSupport -extension NSPreviewSupport on objc.NSItemProvider { +extension NSPreviewSupport on objc.NSItemProvider$2 { + /// loadPreviewImageWithOptions:completionHandler: + void loadPreviewImageWithOptions( + objc.NSDictionary options, { + required DartNSItemProviderCompletionHandler completionHandler, + }) { + objc.checkOsVersionInternal( + 'NSItemProvider.loadPreviewImageWithOptions:completionHandler:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + _objc_msgSend_o762yo( + object$.ref.pointer, + _sel_loadPreviewImageWithOptions_completionHandler_, + options.ref.pointer, + completionHandler.ref.pointer, + ); + } + /// previewImageHandler DartNSItemProviderLoadHandler? get previewImageHandler { objc.checkOsVersionInternal( @@ -92675,14 +93244,14 @@ extension NSPreviewSupport on objc.NSItemProvider { iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0)), ); - final _ret = _objc_msgSend_uwvaik( - this.ref.pointer, + final $ret = _objc_msgSend_uwvaik( + object$.ref.pointer, _sel_previewImageHandler, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary.castFromPointer( - _ret, + : ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObjectImpl_NSDictionary.fromPointer( + $ret, retain: true, release: true, ); @@ -92696,35 +93265,17 @@ extension NSPreviewSupport on objc.NSItemProvider { macOS: (false, (10, 10, 0)), ); _objc_msgSend_f167m6( - this.ref.pointer, + object$.ref.pointer, _sel_setPreviewImageHandler_, value?.ref.pointer ?? ffi.nullptr, ); } - - /// loadPreviewImageWithOptions:completionHandler: - void loadPreviewImageWithOptions( - objc.NSDictionary options, { - required DartNSItemProviderCompletionHandler completionHandler, - }) { - objc.checkOsVersionInternal( - 'NSItemProvider.loadPreviewImageWithOptions:completionHandler:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - _objc_msgSend_o762yo( - this.ref.pointer, - _sel_loadPreviewImageWithOptions_completionHandler_, - options.ref.pointer, - completionHandler.ref.pointer, - ); - } } typedef NSStringEncoding = NSUInteger; -typedef NSStringTransform = ffi.Pointer; +typedef NSStringTransform = ffi.Pointer; typedef DartNSStringTransform = objc.NSString; -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; typedef DartNSStringEncodingDetectionOptionsKey = objc.NSString; late final _class_NSString = objc.getClass("NSString"); late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_ = @@ -92735,22 +93286,22 @@ final _objc_msgSend_1q2ox4r = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.UnsignedLong Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ffi.Pointer, ) > >() .asFunction< int Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ffi.Pointer, ) >(); @@ -92761,7 +93312,7 @@ extension NSStringEncodingDetection on objc.NSString { static DartNSUInteger stringEncodingForData( objc.NSData data, { objc.NSDictionary? encodingOptions, - required ffi.Pointer> convertedString, + required ffi.Pointer> convertedString, required ffi.Pointer usedLossyConversion, }) { objc.checkOsVersionInternal( @@ -92783,46 +93334,12 @@ extension NSStringEncodingDetection on objc.NSString { late final _sel_readableTypeIdentifiersForItemProvider = objc.registerName( "readableTypeIdentifiersForItemProvider", ); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSArray_ffiVoid_closureTrampoline) - .cast(); /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_NSArray_ffiVoid { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock)> - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -92841,12 +93358,12 @@ abstract final class ObjCBlock_NSArray_ffiVoid { fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) + ffi.Pointer Function(ffi.Pointer arg0) > > ptr, ) => objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -92865,30 +93382,67 @@ abstract final class ObjCBlock_NSArray_ffiVoid { bool keepIsolateAlive = true, }) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_NSArray_ffiVoid_closureCallable, + _closureCallable, (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), keepIsolateAlive, ), retain: false, release: true, ); + + static ffi.Pointer _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0) + > + >() + .asFunction< + ffi.Pointer Function(ffi.Pointer) + >()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static ffi.Pointer _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => + (objc.getBlockClosure(block) + as ffi.Pointer Function(ffi.Pointer))( + arg0, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSArray_ffiVoid_CallExtension +extension ObjCBlock_NSArray_ffiVoid$CallExtension on objc.ObjCBlock)> { - objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( + objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.fromPointer( ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer block, ffi.Pointer arg0, ) > >() .asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ) @@ -92903,112 +93457,47 @@ late final _sel_objectWithItemProviderData_typeIdentifier_error_ = objc final _objc_msgSend_1pnyuds = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ) >(); -instancetype -_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -) => block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) - > - >() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >()(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) - .cast(); -instancetype -_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -) => - (objc.getBlockClosure(block) - as instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ))(arg0, arg1, arg2, arg3); -ffi.Pointer -_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) - .cast(); -/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, }) => objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) >(pointer, retain: retain, release: release); @@ -93018,11 +93507,11 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) > fromFunctionPointer( @@ -93030,26 +93519,23 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { ffi.NativeFunction< instancetype Function( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ) > > ptr, ) => objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) >( - objc.newPointerBlock( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -93063,11 +93549,11 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. static objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) > fromFunction( @@ -93075,35 +93561,31 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) fn, { bool keepIsolateAlive = true, }) => objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) >( objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ) => fn( arg0, - objc.NSData.castFromPointer(arg1, retain: true, release: true), - objc.NSString.castFromPointer( - arg2, - retain: true, - release: true, - ), + objc.NSData.fromPointer(arg1, retain: true, release: true), + objc.NSString.fromPointer(arg2, retain: true, release: true), arg3, )?.ref.retainAndAutorelease() ?? ffi.nullptr, @@ -93112,24 +93594,86 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { retain: false, release: true, ); + + static instancetype _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, + ) => block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, + ) + > + >() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ) + >()(arg0, arg1, arg2, arg3); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ) + >(_fnPtrTrampoline) + .cast(); + static instancetype _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, + ) => + (objc.getBlockClosure(block) + as instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ))(arg0, arg1, arg2, arg3); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ) + >(_closureTrampoline) + .cast(); } -/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. -extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension +/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError$CallExtension on objc.ObjCBlock< - ffi.Pointer? Function( + ffi.Pointer? Function( ffi.Pointer, objc.NSData, objc.NSString, - ffi.Pointer>, + ffi.Pointer>, ) > { Dartinstancetype? call( ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, - ffi.Pointer> arg3, + ffi.Pointer> arg3, ) => ref.pointer.ref.invoke .cast< @@ -93137,9 +93681,9 @@ extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension instancetype Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ) > >() @@ -93147,24 +93691,24 @@ extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ) >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) .address == 0 ? null - : objc.ObjCObjectBase( + : objc.ObjCObject( ref.pointer.ref.invoke .cast< ffi.NativeFunction< instancetype Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3, ) > >() @@ -93172,9 +93716,9 @@ extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension instancetype Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, ) >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), retain: true, @@ -93193,73 +93737,19 @@ final _objc_msgSend_16fy0up = objc.msgSendPointer .cast< ffi.NativeFunction< NSInteger Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< int Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >(); -int -_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - int Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer -_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, - 0, - ) - .cast(); -int -_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as int Function(ffi.Pointer, ffi.Pointer))( - arg0, - arg1, - ); -ffi.Pointer -_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = - ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, - 0, - ) - .cast(); /// Construction methods for `objc.ObjCBlock, objc.NSString)>`. abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { @@ -93267,7 +93757,7 @@ abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NS static objc.ObjCBlock< NSInteger Function(ffi.Pointer, objc.NSString) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -93291,16 +93781,13 @@ abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NS ffi.NativeFunction< NSInteger Function( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock, objc.NSString)>( - objc.newPointerBlock( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -93323,22 +93810,69 @@ abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NS ) fn, { bool keepIsolateAlive = true, - }) => objc.ObjCBlock, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSString.castFromPointer(arg1, retain: true, release: true), - ).value, - keepIsolateAlive, - ), - retain: false, - release: true, - ); + }) => + objc.ObjCBlock, objc.NSString)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + objc.NSString.fromPointer(arg1, retain: true, release: true), + ).value, + keepIsolateAlive, + ), + retain: false, + release: true, + ); + + static int _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + int Function(ffi.Pointer, ffi.Pointer) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline, 0) + .cast(); + static int _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as int Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline, 0) + .cast(); } /// Call operator for `objc.ObjCBlock, objc.NSString)>`. -extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension +extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString$CallExtension on objc.ObjCBlock< NSInteger Function(ffi.Pointer, objc.NSString) @@ -93353,7 +93887,7 @@ extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_Call NSInteger Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ) > >() @@ -93361,146 +93895,17 @@ extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_Call int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer), ); } -void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) - > - >() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer) - >()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_NSData_NSError_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, - ffi.Pointer arg1, -) { - try { - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSError_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_NSData_NSError_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_NSData_NSError_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_NSData_NSError_blockingTrampoline) - ..keepIsolateAlive = false; - /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_ffiVoid_NSData_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -93520,17 +93925,14 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > > ptr, ) => objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -93549,17 +93951,17 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { bool keepIsolateAlive = true, }) => objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, + _closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: true, release: true), + : objc.NSData.fromPointer(arg0, retain: true, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer(arg1, retain: true, release: true), + : objc.NSError.fromPointer(arg1, retain: true, release: true), ), keepIsolateAlive, ), @@ -93582,17 +93984,17 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer(arg1, retain: false, release: true), + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -93621,33 +94023,32 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer(arg1, retain: false, release: true), + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_blockingListenerCallable.nativeFunction - .cast(), + _blockingListenerCallable.nativeFunction.cast(), ( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) => fn( arg0.address == 0 ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true), + : objc.NSData.fromPointer(arg0, retain: false, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer(arg1, retain: false, release: true), + : objc.NSError.fromPointer(arg1, retain: false, release: true), ), keepIsolateAlive, ); @@ -93664,10 +94065,142 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSError { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + try { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension +extension ObjCBlock_ffiVoid_NSData_NSError$CallExtension on objc.ObjCBlock { void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke @@ -93675,16 +94208,16 @@ extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg0, + ffi.Pointer arg1, ) > >() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >()( ref.pointer, @@ -93697,64 +94230,6 @@ late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = objc.registerName( "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:", ); -ffi.Pointer -_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >()(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) - .cast(); -ffi.Pointer -_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -) => - (objc.getBlockClosure(block) - as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1, arg2); -ffi.Pointer -_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) - .cast(); /// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { @@ -93766,7 +94241,7 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError objc.ObjCBlock, ) > - castFromPointer( + fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -93794,9 +94269,9 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ffi.Pointer arg2, ) > @@ -93810,10 +94285,7 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError objc.ObjCBlock, ) >( - objc.newPointerBlock( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, - ptr.cast(), - ), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -93850,20 +94322,16 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError ) >( objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, + _closureCallable, ( ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ffi.Pointer arg2, ) => fn( arg0, - objc.NSString.castFromPointer( - arg1, - retain: true, - release: true, - ), - ObjCBlock_ffiVoid_NSData_NSError.castFromPointer( + objc.NSString.fromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_NSData_NSError.fromPointer( arg2, retain: true, release: true, @@ -93875,10 +94343,65 @@ abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError retain: false, release: true, ); + + static ffi.Pointer _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static ffi.Pointer _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension +extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError$CallExtension on objc.ObjCBlock< objc.NSProgress? Function( @@ -93895,42 +94418,42 @@ extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtensi ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ffi.Pointer arg2, ) > >() .asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) .address == 0 ? null - : objc.NSProgress.castFromPointer( + : objc.NSProgress.fromPointer( ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer arg1, ffi.Pointer arg2, ) > >() .asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), @@ -93940,67 +94463,65 @@ extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtensi } /// NSItemProvider -extension NSItemProvider on objc.NSString { - /// readableTypeIdentifiersForItemProvider - static objc.NSArray getReadableTypeIdentifiersForItemProvider() { +extension NSItemProvider$1 on objc.NSString { + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier( + objc.NSString typeIdentifier, + ) { objc.checkOsVersionInternal( - 'NSString.readableTypeIdentifiersForItemProvider', + 'NSString.itemProviderVisibilityForRepresentationWithTypeIdentifier:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_151sglz( - _class_NSString, - _sel_readableTypeIdentifiersForItemProvider, + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSString', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', + ); + } + final $ret = _objc_msgSend_16fy0up( + object$.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSItemProviderRepresentationVisibility.fromValue($ret); } - /// objectWithItemProviderData:typeIdentifier:error: - static objc.NSString? objectWithItemProviderData( - objc.NSData data, { - required objc.NSString typeIdentifier, - required ffi.Pointer> error, + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + objc.NSProgress? loadDataWithTypeIdentifier( + objc.NSString typeIdentifier, { + required objc.ObjCBlock + forItemProviderCompletionHandler, }) { objc.checkOsVersionInternal( - 'NSString.objectWithItemProviderData:typeIdentifier:error:', + 'NSString.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_1pnyuds( - _class_NSString, - _sel_objectWithItemProviderData_typeIdentifier_error_, - data.ref.pointer, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, typeIdentifier.ref.pointer, - error, + forItemProviderCompletionHandler.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// writableTypeIdentifiersForItemProvider - static objc.NSArray getWritableTypeIdentifiersForItemProvider() { - objc.checkOsVersionInternal( - 'NSString.writableTypeIdentifiersForItemProvider', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final _ret = _objc_msgSend_151sglz( - _class_NSString, - _sel_writableTypeIdentifiersForItemProvider, - ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + : objc.NSProgress.fromPointer($ret, retain: true, release: true); } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider$1 { + objc.NSArray get writableTypeIdentifiersForItemProvider { objc.checkOsVersionInternal( 'NSString.writableTypeIdentifiersForItemProvider', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); if (!objc.respondsToSelector( - this.ref.pointer, + object$.ref.pointer, _sel_writableTypeIdentifiersForItemProvider, )) { throw objc.UnimplementedOptionalMethodException( @@ -94008,16 +94529,16 @@ extension NSItemProvider on objc.NSString { 'writableTypeIdentifiersForItemProvider', ); } - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_writableTypeIdentifiersForItemProvider, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } /// itemProviderVisibilityForRepresentationWithTypeIdentifier: static objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier( + itemProviderVisibilityForRepresentationWithTypeIdentifier$1( objc.NSString typeIdentifier, ) { objc.checkOsVersionInternal( @@ -94034,61 +94555,68 @@ extension NSItemProvider on objc.NSString { 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', ); } - final _ret = _objc_msgSend_16fy0up( + final $ret = _objc_msgSend_16fy0up( _class_NSString, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, typeIdentifier.ref.pointer, ); - return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + return objc.NSItemProviderRepresentationVisibility.fromValue($ret); } - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier$1( - objc.NSString typeIdentifier, - ) { + /// objectWithItemProviderData:typeIdentifier:error: + static objc.NSString? objectWithItemProviderData( + objc.NSData data, { + required objc.NSString typeIdentifier, + }) { objc.checkOsVersionInternal( - 'NSString.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + 'NSString.objectWithItemProviderData:typeIdentifier:error:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - if (!objc.respondsToSelector( - this.ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - )) { - throw objc.UnimplementedOptionalMethodException( - 'NSString', - 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', - ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1pnyuds( + _class_NSString, + _sel_objectWithItemProviderData_typeIdentifier_error_, + data.ref.pointer, + typeIdentifier.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); } - final _ret = _objc_msgSend_16fy0up( - this.ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - typeIdentifier.ref.pointer, + } + + /// readableTypeIdentifiersForItemProvider + static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal( + 'NSString.readableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $ret = _objc_msgSend_151sglz( + _class_NSString, + _sel_readableTypeIdentifiersForItemProvider, ); - return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: - objc.NSProgress? loadDataWithTypeIdentifier( - objc.NSString typeIdentifier, { - required objc.ObjCBlock - forItemProviderCompletionHandler, - }) { + /// writableTypeIdentifiersForItemProvider + static objc.NSArray getWritableTypeIdentifiersForItemProvider$1() { objc.checkOsVersionInternal( - 'NSString.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', + 'NSString.writableTypeIdentifiersForItemProvider', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - typeIdentifier.ref.pointer, - forItemProviderCompletionHandler.ref.pointer, + final $ret = _objc_msgSend_151sglz( + _class_NSString, + _sel_writableTypeIdentifiersForItemProvider, ); - return _ret.address == 0 - ? null - : objc.NSProgress.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } } @@ -94100,18 +94628,18 @@ final _objc_msgSend_djsa9o = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong, ) > >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ) >(); @@ -94122,7 +94650,7 @@ final _objc_msgSend_1e3pm0z = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, objc.NSRange, ) @@ -94130,7 +94658,7 @@ final _objc_msgSend_1e3pm0z = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, objc.NSRange, ) @@ -94144,10 +94672,10 @@ final _objc_msgSend_1upeo1d = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.UnsignedLong Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, NSUInteger, objc.NSRange, ) @@ -94155,10 +94683,10 @@ final _objc_msgSend_1upeo1d = objc.msgSendPointer >() .asFunction< int Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, objc.NSRange, ) @@ -94170,9 +94698,9 @@ final _objc_msgSend_zy00wz = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Bool, objc.NSRange, ffi.Pointer, @@ -94181,9 +94709,9 @@ final _objc_msgSend_zy00wz = objc.msgSendPointer >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, bool, objc.NSRange, ffi.Pointer, @@ -94194,69 +94722,24 @@ late final _sel_stringWithCapacity_ = objc.registerName("stringWithCapacity:"); /// NSMutableStringExtensionMethods extension NSMutableStringExtensionMethods on objc.NSMutableString { - /// insertString:atIndex: - void insertString(objc.NSString aString, {required DartNSUInteger atIndex}) { - _objc_msgSend_djsa9o( - this.ref.pointer, - _sel_insertString_atIndex_, - aString.ref.pointer, - atIndex, - ); - } - - /// deleteCharactersInRange: - void deleteCharactersInRange(NSRange range) { - _objc_msgSend_1e3pm0z( - this.ref.pointer, - _sel_deleteCharactersInRange_, - range, - ); - } - - /// appendString: - void appendString(objc.NSString aString) { - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_appendString_, - aString.ref.pointer, - ); - } - /// appendFormat: void appendFormat(objc.NSString format) { _objc_msgSend_xtuoz7( - this.ref.pointer, + object$.ref.pointer, _sel_appendFormat_, format.ref.pointer, ); } - /// setString: - void setString(objc.NSString aString) { + /// appendString: + void appendString(objc.NSString aString) { _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_setString_, + object$.ref.pointer, + _sel_appendString_, aString.ref.pointer, ); } - /// replaceOccurrencesOfString:withString:options:range: - DartNSUInteger replaceOccurrencesOfString( - objc.NSString target, { - required objc.NSString withString, - required objc.NSStringCompareOptions options, - required NSRange range, - }) { - return _objc_msgSend_1upeo1d( - this.ref.pointer, - _sel_replaceOccurrencesOfString_withString_options_range_, - target.ref.pointer, - withString.ref.pointer, - options.value, - range, - ); - } - /// applyTransform:reverse:range:updatedRange: bool applyTransform( DartNSStringTransform transform, { @@ -94270,7 +94753,7 @@ extension NSMutableStringExtensionMethods on objc.NSMutableString { macOS: (false, (10, 11, 0)), ); return _objc_msgSend_zy00wz( - this.ref.pointer, + object$.ref.pointer, _sel_applyTransform_reverse_range_updatedRange_, transform.ref.pointer, reverse, @@ -94279,32 +94762,69 @@ extension NSMutableStringExtensionMethods on objc.NSMutableString { ); } + /// deleteCharactersInRange: + void deleteCharactersInRange(NSRange range) { + _objc_msgSend_1e3pm0z( + object$.ref.pointer, + _sel_deleteCharactersInRange_, + range, + ); + } + /// initWithCapacity: objc.NSMutableString initWithCapacity(DartNSUInteger capacity) { - final _ret = _objc_msgSend_14hpxwa( - this.ref.retainAndReturnPointer(), + final $ret = _objc_msgSend_14hpxwa( + object$.ref.retainAndReturnPointer(), _sel_initWithCapacity_, capacity, ); - return objc.NSMutableString.castFromPointer( - _ret, - retain: false, - release: true, + return objc.NSMutableString.fromPointer($ret, retain: false, release: true); + } + + /// insertString:atIndex: + void insertString(objc.NSString aString, {required DartNSUInteger atIndex}) { + _objc_msgSend_djsa9o( + object$.ref.pointer, + _sel_insertString_atIndex_, + aString.ref.pointer, + atIndex, + ); + } + + /// replaceOccurrencesOfString:withString:options:range: + DartNSUInteger replaceOccurrencesOfString( + objc.NSString target, { + required objc.NSString withString, + required objc.NSStringCompareOptions options, + required NSRange range, + }) { + return _objc_msgSend_1upeo1d( + object$.ref.pointer, + _sel_replaceOccurrencesOfString_withString_options_range_, + target.ref.pointer, + withString.ref.pointer, + options, + range, + ); + } + + /// setString: + void setString(objc.NSString aString) { + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_setString_, + aString.ref.pointer, ); } /// stringWithCapacity: static objc.NSMutableString stringWithCapacity(DartNSUInteger capacity) { - final _ret = _objc_msgSend_14hpxwa( + final $ret = _objc_msgSend_14hpxwa( _class_NSMutableString, _sel_stringWithCapacity_, capacity, ); - return objc.NSMutableString.castFromPointer( - _ret, - retain: true, - release: true, - ); + return objc.NSMutableString.fromPointer($ret, retain: true, release: true); } } @@ -94316,20 +94836,20 @@ late final _sel_propertyListFromStringsFileFormat = objc.registerName( /// NSExtendedStringPropertyListParsing extension NSExtendedStringPropertyListParsing on objc.NSString { /// propertyList - objc.ObjCObjectBase propertyList() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_propertyList); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + objc.ObjCObject propertyList() { + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_propertyList); + return objc.ObjCObject($ret, retain: true, release: true); } /// propertyListFromStringsFileFormat objc.NSDictionary? propertyListFromStringsFileFormat() { - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_propertyListFromStringsFileFormat, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); } } @@ -94338,14 +94858,14 @@ final _objc_msgSend_1fuqfwb = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) > >() .asFunction< ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ) >(); @@ -94356,7 +94876,7 @@ final _objc_msgSend_1r7ue5f = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -94364,7 +94884,7 @@ final _objc_msgSend_1r7ue5f = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -94376,7 +94896,7 @@ final _objc_msgSend_1h3mito = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong, @@ -94385,7 +94905,7 @@ final _objc_msgSend_1h3mito = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, int, @@ -94398,7 +94918,7 @@ final _objc_msgSend_3gpdva = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong, @@ -94409,7 +94929,7 @@ final _objc_msgSend_3gpdva = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, int, @@ -94429,8 +94949,8 @@ late final _sel_initWithCStringNoCopy_length_freeWhenDone_ = objc.registerName( final _objc_msgSend_1ojrli4 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong, @@ -94439,8 +94959,8 @@ final _objc_msgSend_1ojrli4 = objc.msgSendPointer > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, int, @@ -94453,8 +94973,8 @@ late final _sel_initWithCString_length_ = objc.registerName( final _objc_msgSend_erqryg = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong, @@ -94462,8 +94982,8 @@ final _objc_msgSend_erqryg = objc.msgSendPointer > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, int, @@ -94473,16 +94993,16 @@ late final _sel_initWithCString_ = objc.registerName("initWithCString:"); final _objc_msgSend_56zxyn = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -94496,7 +95016,7 @@ final _objc_msgSend_g3kdhc = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -94504,7 +95024,7 @@ final _objc_msgSend_g3kdhc = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -94519,17 +95039,7 @@ extension NSStringDeprecated on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_cString); - } - - /// lossyCString - ffi.Pointer lossyCString() { - objc.checkOsVersionInternal( - 'NSString.lossyCString', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_lossyCString); + return _objc_msgSend_1fuqfwb(object$.ref.pointer, _sel_cString); } /// cStringLength @@ -94539,7 +95049,7 @@ extension NSStringDeprecated on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_cStringLength); + return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_cStringLength); } /// getCString: @@ -94549,7 +95059,7 @@ extension NSStringDeprecated on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - _objc_msgSend_1r7ue5f(this.ref.pointer, _sel_getCString_, bytes); + _objc_msgSend_1r7ue5f(object$.ref.pointer, _sel_getCString_, bytes); } /// getCString:maxLength: @@ -94563,7 +95073,7 @@ extension NSStringDeprecated on objc.NSString { macOS: (false, (10, 0, 0)), ); _objc_msgSend_1h3mito( - this.ref.pointer, + object$.ref.pointer, _sel_getCString_maxLength_, bytes, maxLength, @@ -94583,7 +95093,7 @@ extension NSStringDeprecated on objc.NSString { macOS: (false, (10, 0, 0)), ); _objc_msgSend_3gpdva( - this.ref.pointer, + object$.ref.pointer, _sel_getCString_maxLength_range_remainingRange_, bytes, maxLength, @@ -94592,167 +95102,165 @@ extension NSStringDeprecated on objc.NSString { ); } - /// writeToFile:atomically: - bool writeToFile(objc.NSString path, {required bool atomically}) { + /// getCharacters: + void getCharacters(ffi.Pointer buffer) { + _objc_msgSend_g3kdhc(object$.ref.pointer, _sel_getCharacters_, buffer); + } + + /// initWithCString: + objc.ObjCObject? initWithCString(ffi.Pointer bytes) { objc.checkOsVersionInternal( - 'NSString.writeToFile:atomically:', + 'NSString.initWithCString:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_1iyq28l( - this.ref.pointer, - _sel_writeToFile_atomically_, - path.ref.pointer, - atomically, + final $ret = _objc_msgSend_56zxyn( + object$.ref.retainAndReturnPointer(), + _sel_initWithCString_, + bytes, ); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: false, release: true); } - /// writeToURL:atomically: - bool writeToURL(objc.NSURL url, {required bool atomically}) { + /// initWithCString:length: + objc.ObjCObject? initWithCString$1( + ffi.Pointer bytes, { + required DartNSUInteger length, + }) { objc.checkOsVersionInternal( - 'NSString.writeToURL:atomically:', + 'NSString.initWithCString:length:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_1iyq28l( - this.ref.pointer, - _sel_writeToURL_atomically_, - url.ref.pointer, - atomically, + final $ret = _objc_msgSend_erqryg( + object$.ref.retainAndReturnPointer(), + _sel_initWithCString_length_, + bytes, + length, ); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: false, release: true); } - /// initWithContentsOfFile: - objc.ObjCObjectBase? initWithContentsOfFile(objc.NSString path) { + /// initWithCStringNoCopy:length:freeWhenDone: + objc.ObjCObject? initWithCStringNoCopy( + ffi.Pointer bytes, { + required DartNSUInteger length, + required bool freeWhenDone, + }) { objc.checkOsVersionInternal( - 'NSString.initWithContentsOfFile:', + 'NSString.initWithCStringNoCopy:length:freeWhenDone:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, - path.ref.pointer, + final $ret = _objc_msgSend_1ojrli4( + object$.ref.retainAndReturnPointer(), + _sel_initWithCStringNoCopy_length_freeWhenDone_, + bytes, + length, + freeWhenDone, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); + : objc.ObjCObject($ret, retain: false, release: true); } - /// initWithContentsOfURL: - objc.ObjCObjectBase? initWithContentsOfURL(objc.NSURL url) { + /// initWithContentsOfFile: + objc.ObjCObject? initWithContentsOfFile(objc.NSString path) { objc.checkOsVersionInternal( - 'NSString.initWithContentsOfURL:', + 'NSString.initWithContentsOfFile:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, - url.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, + path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); + : objc.ObjCObject($ret, retain: false, release: true); } - /// stringWithContentsOfFile: - static objc.ObjCObjectBase? stringWithContentsOfFile(objc.NSString path) { + /// initWithContentsOfURL: + objc.ObjCObject? initWithContentsOfURL(objc.NSURL url) { objc.checkOsVersionInternal( - 'NSString.stringWithContentsOfFile:', + 'NSString.initWithContentsOfURL:', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSString, - _sel_stringWithContentsOfFile_, - path.ref.pointer, + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, + url.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: false, release: true); } - /// stringWithContentsOfURL: - static objc.ObjCObjectBase? stringWithContentsOfURL(objc.NSURL url) { + /// lossyCString + ffi.Pointer lossyCString() { objc.checkOsVersionInternal( - 'NSString.stringWithContentsOfURL:', + 'NSString.lossyCString', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSString, - _sel_stringWithContentsOfURL_, - url.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + return _objc_msgSend_1fuqfwb(object$.ref.pointer, _sel_lossyCString); } - /// initWithCStringNoCopy:length:freeWhenDone: - objc.ObjCObjectBase? initWithCStringNoCopy( - ffi.Pointer bytes, { - required DartNSUInteger length, - required bool freeWhenDone, - }) { + /// writeToFile:atomically: + bool writeToFile(objc.NSString path, {required bool atomically}) { objc.checkOsVersionInternal( - 'NSString.initWithCStringNoCopy:length:freeWhenDone:', + 'NSString.writeToFile:atomically:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1ojrli4( - this.ref.retainAndReturnPointer(), - _sel_initWithCStringNoCopy_length_freeWhenDone_, - bytes, - length, - freeWhenDone, + return _objc_msgSend_1iyq28l( + object$.ref.pointer, + _sel_writeToFile_atomically_, + path.ref.pointer, + atomically, ); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); } - /// initWithCString:length: - objc.ObjCObjectBase? initWithCString( - ffi.Pointer bytes, { - required DartNSUInteger length, - }) { + /// writeToURL:atomically: + bool writeToURL(objc.NSURL url, {required bool atomically}) { objc.checkOsVersionInternal( - 'NSString.initWithCString:length:', + 'NSString.writeToURL:atomically:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_erqryg( - this.ref.retainAndReturnPointer(), - _sel_initWithCString_length_, - bytes, - length, + return _objc_msgSend_1iyq28l( + object$.ref.pointer, + _sel_writeToURL_atomically_, + url.ref.pointer, + atomically, ); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); } - /// initWithCString: - objc.ObjCObjectBase? initWithCString$1(ffi.Pointer bytes) { + /// stringWithCString: + static objc.ObjCObject? stringWithCString(ffi.Pointer bytes) { objc.checkOsVersionInternal( - 'NSString.initWithCString:', + 'NSString.stringWithCString:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_56zxyn( - this.ref.retainAndReturnPointer(), - _sel_initWithCString_, + final $ret = _objc_msgSend_56zxyn( + _class_NSString, + _sel_stringWithCString_, bytes, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } /// stringWithCString:length: - static objc.ObjCObjectBase? stringWithCString( + static objc.ObjCObject? stringWithCString$1( ffi.Pointer bytes, { required DartNSUInteger length, }) { @@ -94761,53 +95269,65 @@ extension NSStringDeprecated on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_erqryg( + final $ret = _objc_msgSend_erqryg( _class_NSString, _sel_stringWithCString_length_, bytes, length, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } - /// stringWithCString: - static objc.ObjCObjectBase? stringWithCString$1(ffi.Pointer bytes) { + /// stringWithContentsOfFile: + static objc.ObjCObject? stringWithContentsOfFile(objc.NSString path) { objc.checkOsVersionInternal( - 'NSString.stringWithCString:', + 'NSString.stringWithContentsOfFile:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_56zxyn( + final $ret = _objc_msgSend_1sotr3r( _class_NSString, - _sel_stringWithCString_, - bytes, + _sel_stringWithContentsOfFile_, + path.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } - /// getCharacters: - void getCharacters(ffi.Pointer buffer) { - _objc_msgSend_g3kdhc(this.ref.pointer, _sel_getCharacters_, buffer); + /// stringWithContentsOfURL: + static objc.ObjCObject? stringWithContentsOfURL(objc.NSURL url) { + objc.checkOsVersionInternal( + 'NSString.stringWithContentsOfURL:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1sotr3r( + _class_NSString, + _sel_stringWithContentsOfURL_, + url.ref.pointer, + ); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: true, release: true); } } -typedef NSURLResourceKey = ffi.Pointer; +typedef NSURLResourceKey = ffi.Pointer; typedef DartNSURLResourceKey = objc.NSString; -typedef NSURLFileResourceType = ffi.Pointer; +typedef NSURLFileResourceType = ffi.Pointer; typedef DartNSURLFileResourceType = objc.NSString; -typedef NSURLThumbnailDictionaryItem = ffi.Pointer; +typedef NSURLThumbnailDictionaryItem = ffi.Pointer; typedef DartNSURLThumbnailDictionaryItem = objc.NSString; -typedef NSURLFileProtectionType = ffi.Pointer; +typedef NSURLFileProtectionType = ffi.Pointer; typedef DartNSURLFileProtectionType = objc.NSString; -typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; +typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; typedef DartNSURLUbiquitousItemDownloadingStatus = objc.NSString; -typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; +typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; typedef DartNSURLUbiquitousSharedItemRole = objc.NSString; -typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; +typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; typedef DartNSURLUbiquitousSharedItemPermissions = objc.NSString; typedef NSURLBookmarkFileCreationOptions = NSUInteger; late final _class_NSURL = objc.getClass("NSURL"); @@ -94818,21 +95338,21 @@ final _objc_msgSend_1j9bhml = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>, ) >(); late final _sel_promisedItemResourceValuesForKeys_error_ = objc.registerName( @@ -94845,22 +95365,43 @@ final _objc_msgSend_1dom33q = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer>, + ffi.Pointer>, ) >(); /// NSPromisedItems extension NSPromisedItems on objc.NSURL { + /// checkPromisedItemIsReachableAndReturnError: + bool checkPromisedItemIsReachableAndReturnError() { + objc.checkOsVersionInternal( + 'NSURL.checkPromisedItemIsReachableAndReturnError:', + iOS: (false, (8, 0, 0)), + macOS: (false, (10, 10, 0)), + ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1dom33q( + object$.ref.pointer, + _sel_checkPromisedItemIsReachableAndReturnError_, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret; + } finally { + pkg_ffi.calloc.free($err); + } + } + /// Get resource values from URLs of 'promised' items. A promised item is not guaranteed to have its contents in the file system until you use NSFileCoordinator to perform a coordinated read on its URL, which causes the contents to be downloaded or otherwise generated. Promised item URLs are returned by various APIs, including currently: /// - NSMetadataQueryUbiquitousDataScope /// - NSMetadataQueryUbiquitousDocumentsScope @@ -94872,124 +95413,115 @@ extension NSPromisedItems on objc.NSURL { /// /// Most of the NSURL resource value keys will work with these APIs. However, there are some that are tied to the item's contents that will not work, such as NSURLContentAccessDateKey or NSURLGenerationIdentifierKey. If one of these keys is used, the method will return YES, but the value for the key will be nil. bool getPromisedItemResourceValue( - ffi.Pointer> value, { + ffi.Pointer> value, { required DartNSURLResourceKey forKey, - required ffi.Pointer> error, }) { objc.checkOsVersionInternal( 'NSURL.getPromisedItemResourceValue:forKey:error:', iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0)), ); - return _objc_msgSend_1j9bhml( - this.ref.pointer, - _sel_getPromisedItemResourceValue_forKey_error_, - value, - forKey.ref.pointer, - error, - ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1j9bhml( + object$.ref.pointer, + _sel_getPromisedItemResourceValue_forKey_error_, + value, + forKey.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret; + } finally { + pkg_ffi.calloc.free($err); + } } /// promisedItemResourceValuesForKeys:error: - objc.NSDictionary? promisedItemResourceValuesForKeys( - objc.NSArray keys, { - required ffi.Pointer> error, - }) { + objc.NSDictionary? promisedItemResourceValuesForKeys(objc.NSArray keys) { objc.checkOsVersionInternal( 'NSURL.promisedItemResourceValuesForKeys:error:', iOS: (false, (8, 0, 0)), macOS: (false, (10, 10, 0)), ); - final _ret = _objc_msgSend_1lhpu4m( - this.ref.pointer, - _sel_promisedItemResourceValuesForKeys_error_, - keys.ref.pointer, - error, - ); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// checkPromisedItemIsReachableAndReturnError: - bool checkPromisedItemIsReachableAndReturnError( - ffi.Pointer> error, - ) { - objc.checkOsVersionInternal( - 'NSURL.checkPromisedItemIsReachableAndReturnError:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - return _objc_msgSend_1dom33q( - this.ref.pointer, - _sel_checkPromisedItemIsReachableAndReturnError_, - error, - ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + object$.ref.pointer, + _sel_promisedItemResourceValuesForKeys_error_, + keys.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSDictionary.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); + } } } /// NSItemProvider -extension NSItemProvider$1 on objc.NSURL { - /// readableTypeIdentifiersForItemProvider - static objc.NSArray getReadableTypeIdentifiersForItemProvider() { +extension NSItemProvider on objc.NSURL { + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier( + objc.NSString typeIdentifier, + ) { objc.checkOsVersionInternal( - 'NSURL.readableTypeIdentifiersForItemProvider', + 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_151sglz( - _class_NSURL, - _sel_readableTypeIdentifiersForItemProvider, + if (!objc.respondsToSelector( + object$.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + )) { + throw objc.UnimplementedOptionalMethodException( + 'NSURL', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', + ); + } + final $ret = _objc_msgSend_16fy0up( + object$.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSItemProviderRepresentationVisibility.fromValue($ret); } - /// objectWithItemProviderData:typeIdentifier:error: - static objc.NSURL? objectWithItemProviderData( - objc.NSData data, { - required objc.NSString typeIdentifier, - required ffi.Pointer> error, + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + objc.NSProgress? loadDataWithTypeIdentifier( + objc.NSString typeIdentifier, { + required objc.ObjCBlock + forItemProviderCompletionHandler, }) { objc.checkOsVersionInternal( - 'NSURL.objectWithItemProviderData:typeIdentifier:error:', + 'NSURL.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_1pnyuds( - _class_NSURL, - _sel_objectWithItemProviderData_typeIdentifier_error_, - data.ref.pointer, + final $ret = _objc_msgSend_r0bo0s( + object$.ref.pointer, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, typeIdentifier.ref.pointer, - error, + forItemProviderCompletionHandler.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// writableTypeIdentifiersForItemProvider - static objc.NSArray getWritableTypeIdentifiersForItemProvider() { - objc.checkOsVersionInternal( - 'NSURL.writableTypeIdentifiersForItemProvider', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final _ret = _objc_msgSend_151sglz( - _class_NSURL, - _sel_writableTypeIdentifiersForItemProvider, - ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + : objc.NSProgress.fromPointer($ret, retain: true, release: true); } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider$1 { + objc.NSArray get writableTypeIdentifiersForItemProvider { objc.checkOsVersionInternal( 'NSURL.writableTypeIdentifiersForItemProvider', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); if (!objc.respondsToSelector( - this.ref.pointer, + object$.ref.pointer, _sel_writableTypeIdentifiersForItemProvider, )) { throw objc.UnimplementedOptionalMethodException( @@ -94997,16 +95529,16 @@ extension NSItemProvider$1 on objc.NSURL { 'writableTypeIdentifiersForItemProvider', ); } - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, _sel_writableTypeIdentifiersForItemProvider, ); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } /// itemProviderVisibilityForRepresentationWithTypeIdentifier: static objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier( + itemProviderVisibilityForRepresentationWithTypeIdentifier$1( objc.NSString typeIdentifier, ) { objc.checkOsVersionInternal( @@ -95023,61 +95555,68 @@ extension NSItemProvider$1 on objc.NSURL { 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', ); } - final _ret = _objc_msgSend_16fy0up( + final $ret = _objc_msgSend_16fy0up( _class_NSURL, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, typeIdentifier.ref.pointer, ); - return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + return objc.NSItemProviderRepresentationVisibility.fromValue($ret); } - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier$1( - objc.NSString typeIdentifier, - ) { + /// objectWithItemProviderData:typeIdentifier:error: + static objc.NSURL? objectWithItemProviderData( + objc.NSData data, { + required objc.NSString typeIdentifier, + }) { objc.checkOsVersionInternal( - 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', + 'NSURL.objectWithItemProviderData:typeIdentifier:error:', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - if (!objc.respondsToSelector( - this.ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - )) { - throw objc.UnimplementedOptionalMethodException( - 'NSURL', - 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', - ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1pnyuds( + _class_NSURL, + _sel_objectWithItemProviderData_typeIdentifier_error_, + data.ref.pointer, + typeIdentifier.ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : objc.NSURL.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); } - final _ret = _objc_msgSend_16fy0up( - this.ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - typeIdentifier.ref.pointer, + } + + /// readableTypeIdentifiersForItemProvider + static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + objc.checkOsVersionInternal( + 'NSURL.readableTypeIdentifiersForItemProvider', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), ); - return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + final $ret = _objc_msgSend_151sglz( + _class_NSURL, + _sel_readableTypeIdentifiersForItemProvider, + ); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: - objc.NSProgress? loadDataWithTypeIdentifier( - objc.NSString typeIdentifier, { - required objc.ObjCBlock - forItemProviderCompletionHandler, - }) { + /// writableTypeIdentifiersForItemProvider + static objc.NSArray getWritableTypeIdentifiersForItemProvider$1() { objc.checkOsVersionInternal( - 'NSURL.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', + 'NSURL.writableTypeIdentifiersForItemProvider', iOS: (false, (11, 0, 0)), macOS: (false, (10, 13, 0)), ); - final _ret = _objc_msgSend_r0bo0s( - this.ref.pointer, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - typeIdentifier.ref.pointer, - forItemProviderCompletionHandler.ref.pointer, + final $ret = _objc_msgSend_151sglz( + _class_NSURL, + _sel_writableTypeIdentifiersForItemProvider, ); - return _ret.address == 0 - ? null - : objc.NSProgress.castFromPointer(_ret, retain: true, release: true); + return objc.NSArray.fromPointer($ret, retain: true, release: true); } } @@ -95102,59 +95641,47 @@ late final _sel_URLFragmentAllowedCharacterSet = objc.registerName( ); /// NSURLUtilities -extension NSURLUtilities on objc.NSCharacterSet { - /// Returns a character set containing the characters allowed in a URL's user subcomponent. - static objc.NSCharacterSet getURLUserAllowedCharacterSet() { +extension NSURLUtilities$1 on objc.NSCharacterSet { + /// Returns a character set containing the characters allowed in a URL's fragment component. + static objc.NSCharacterSet getURLFragmentAllowedCharacterSet() { objc.checkOsVersionInternal( - 'NSCharacterSet.URLUserAllowedCharacterSet', + 'NSCharacterSet.URLFragmentAllowedCharacterSet', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, - _sel_URLUserAllowedCharacterSet, - ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, + _sel_URLFragmentAllowedCharacterSet, ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } - /// Returns a character set containing the characters allowed in a URL's password subcomponent. - static objc.NSCharacterSet getURLPasswordAllowedCharacterSet() { + /// Returns a character set containing the characters allowed in a URL's host subcomponent. + static objc.NSCharacterSet getURLHostAllowedCharacterSet() { objc.checkOsVersionInternal( - 'NSCharacterSet.URLPasswordAllowedCharacterSet', + 'NSCharacterSet.URLHostAllowedCharacterSet', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, - _sel_URLPasswordAllowedCharacterSet, - ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, + _sel_URLHostAllowedCharacterSet, ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } - /// Returns a character set containing the characters allowed in a URL's host subcomponent. - static objc.NSCharacterSet getURLHostAllowedCharacterSet() { + /// Returns a character set containing the characters allowed in a URL's password subcomponent. + static objc.NSCharacterSet getURLPasswordAllowedCharacterSet() { objc.checkOsVersionInternal( - 'NSCharacterSet.URLHostAllowedCharacterSet', + 'NSCharacterSet.URLPasswordAllowedCharacterSet', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, - _sel_URLHostAllowedCharacterSet, - ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, + _sel_URLPasswordAllowedCharacterSet, ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } /// Returns a character set containing the characters allowed in a URL's path component. ';' is a legal path character, but it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). @@ -95164,15 +95691,11 @@ extension NSURLUtilities on objc.NSCharacterSet { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLPathAllowedCharacterSet, ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, - ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } /// Returns a character set containing the characters allowed in a URL's query component. @@ -95182,33 +95705,25 @@ extension NSURLUtilities on objc.NSCharacterSet { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, _sel_URLQueryAllowedCharacterSet, ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, - ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } - /// Returns a character set containing the characters allowed in a URL's fragment component. - static objc.NSCharacterSet getURLFragmentAllowedCharacterSet() { + /// Returns a character set containing the characters allowed in a URL's user subcomponent. + static objc.NSCharacterSet getURLUserAllowedCharacterSet() { objc.checkOsVersionInternal( - 'NSCharacterSet.URLFragmentAllowedCharacterSet', + 'NSCharacterSet.URLUserAllowedCharacterSet', iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_151sglz( + final $ret = _objc_msgSend_151sglz( _class_NSCharacterSet, - _sel_URLFragmentAllowedCharacterSet, - ); - return objc.NSCharacterSet.castFromPointer( - _ret, - retain: true, - release: true, + _sel_URLUserAllowedCharacterSet, ); + return objc.NSCharacterSet.fromPointer($ret, retain: true, release: true); } } @@ -95224,7 +95739,7 @@ late final _sel_stringByReplacingPercentEscapesUsingEncoding_ = objc .registerName("stringByReplacingPercentEscapesUsingEncoding:"); /// NSURLUtilities -extension NSURLUtilities$1 on objc.NSString { +extension NSURLUtilities on objc.NSString { /// Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode a URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored. objc.NSString? stringByAddingPercentEncodingWithAllowedCharacters( objc.NSCharacterSet allowedCharacters, @@ -95234,30 +95749,14 @@ extension NSURLUtilities$1 on objc.NSString { iOS: (false, (7, 0, 0)), macOS: (false, (10, 9, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_stringByAddingPercentEncodingWithAllowedCharacters_, allowedCharacters.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters. - objc.NSString? get stringByRemovingPercentEncoding { - objc.checkOsVersionInternal( - 'NSString.stringByRemovingPercentEncoding', - iOS: (false, (7, 0, 0)), - macOS: (false, (10, 9, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_stringByRemovingPercentEncoding, - ); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } /// stringByAddingPercentEscapesUsingEncoding: @@ -95267,14 +95766,30 @@ extension NSURLUtilities$1 on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_14hpxwa( - this.ref.pointer, + final $ret = _objc_msgSend_14hpxwa( + object$.ref.pointer, _sel_stringByAddingPercentEscapesUsingEncoding_, enc, ); - return _ret.address == 0 + return $ret.address == 0 + ? null + : objc.NSString.fromPointer($ret, retain: true, release: true); + } + + /// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters. + objc.NSString? get stringByRemovingPercentEncoding { + objc.checkOsVersionInternal( + 'NSString.stringByRemovingPercentEncoding', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_stringByRemovingPercentEncoding, + ); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } /// stringByReplacingPercentEscapesUsingEncoding: @@ -95286,14 +95801,14 @@ extension NSURLUtilities$1 on objc.NSString { iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_14hpxwa( - this.ref.pointer, + final $ret = _objc_msgSend_14hpxwa( + object$.ref.pointer, _sel_stringByReplacingPercentEscapesUsingEncoding_, enc, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } } @@ -95330,198 +95845,206 @@ late final _sel_URLByResolvingSymlinksInPath = objc.registerName( /// NSURLPathUtilities extension NSURLPathUtilities on objc.NSURL { - /// The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do. - static objc.NSURL? fileURLWithPathComponents(objc.NSArray components) { + /// URLByAppendingPathComponent: + objc.NSURL? URLByAppendingPathComponent(objc.NSString pathComponent) { objc.checkOsVersionInternal( - 'NSURL.fileURLWithPathComponents:', + 'NSURL.URLByAppendingPathComponent:', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - _class_NSURL, - _sel_fileURLWithPathComponents_, - components.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_URLByAppendingPathComponent_, + pathComponent.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// pathComponents - objc.NSArray? get pathComponents { + /// URLByAppendingPathComponent:isDirectory: + objc.NSURL? URLByAppendingPathComponent$1( + objc.NSString pathComponent, { + required bool isDirectory, + }) { objc.checkOsVersionInternal( - 'NSURL.pathComponents', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), + 'NSURL.URLByAppendingPathComponent:isDirectory:', + iOS: (false, (5, 0, 0)), + macOS: (false, (10, 7, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_pathComponents); - return _ret.address == 0 + final $ret = _objc_msgSend_17amj0z( + object$.ref.pointer, + _sel_URLByAppendingPathComponent_isDirectory_, + pathComponent.ref.pointer, + isDirectory, + ); + return $ret.address == 0 ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// lastPathComponent - objc.NSString? get lastPathComponent { + /// URLByAppendingPathExtension: + objc.NSURL? URLByAppendingPathExtension(objc.NSString pathExtension) { objc.checkOsVersionInternal( - 'NSURL.lastPathComponent', + 'NSURL.URLByAppendingPathExtension:', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_lastPathComponent, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, + _sel_URLByAppendingPathExtension_, + pathExtension.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// pathExtension - objc.NSString? get pathExtension { + /// URLByDeletingLastPathComponent + objc.NSURL? get URLByDeletingLastPathComponent { objc.checkOsVersionInternal( - 'NSURL.pathExtension', + 'NSURL.URLByDeletingLastPathComponent', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_pathExtension); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_URLByDeletingLastPathComponent, + ); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// URLByAppendingPathComponent: - objc.NSURL? URLByAppendingPathComponent(objc.NSString pathComponent) { + /// URLByDeletingPathExtension + objc.NSURL? get URLByDeletingPathExtension { objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathComponent:', + 'NSURL.URLByDeletingPathExtension', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_URLByAppendingPathComponent_, - pathComponent.ref.pointer, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_URLByDeletingPathExtension, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// URLByAppendingPathComponent:isDirectory: - objc.NSURL? URLByAppendingPathComponent$1( - objc.NSString pathComponent, { - required bool isDirectory, - }) { + /// URLByResolvingSymlinksInPath + objc.NSURL? get URLByResolvingSymlinksInPath { objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathComponent:isDirectory:', - iOS: (false, (5, 0, 0)), - macOS: (false, (10, 7, 0)), + 'NSURL.URLByResolvingSymlinksInPath', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_17amj0z( - this.ref.pointer, - _sel_URLByAppendingPathComponent_isDirectory_, - pathComponent.ref.pointer, - isDirectory, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_URLByResolvingSymlinksInPath, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// URLByDeletingLastPathComponent - objc.NSURL? get URLByDeletingLastPathComponent { + /// URLByStandardizingPath + objc.NSURL? get URLByStandardizingPath { objc.checkOsVersionInternal( - 'NSURL.URLByDeletingLastPathComponent', + 'NSURL.URLByStandardizingPath', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_URLByDeletingLastPathComponent, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_URLByStandardizingPath, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } - /// URLByAppendingPathExtension: - objc.NSURL? URLByAppendingPathExtension(objc.NSString pathExtension$1) { + /// Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation. + bool checkResourceIsReachableAndReturnError() { objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathExtension:', + 'NSURL.checkResourceIsReachableAndReturnError:', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, - _sel_URLByAppendingPathExtension_, - pathExtension$1.ref.pointer, - ); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1dom33q( + object$.ref.pointer, + _sel_checkResourceIsReachableAndReturnError_, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret; + } finally { + pkg_ffi.calloc.free($err); + } } - /// URLByDeletingPathExtension - objc.NSURL? get URLByDeletingPathExtension { + /// lastPathComponent + objc.NSString? get lastPathComponent { objc.checkOsVersionInternal( - 'NSURL.URLByDeletingPathExtension', + 'NSURL.lastPathComponent', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_URLByDeletingPathExtension, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_lastPathComponent, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation. - bool checkResourceIsReachableAndReturnError( - ffi.Pointer> error, - ) { + /// pathComponents + objc.NSArray? get pathComponents { objc.checkOsVersionInternal( - 'NSURL.checkResourceIsReachableAndReturnError:', + 'NSURL.pathComponents', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - return _objc_msgSend_1dom33q( - this.ref.pointer, - _sel_checkResourceIsReachableAndReturnError_, - error, + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_pathComponents, ); + return $ret.address == 0 + ? null + : objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// URLByStandardizingPath - objc.NSURL? get URLByStandardizingPath { + /// pathExtension + objc.NSString? get pathExtension { objc.checkOsVersionInternal( - 'NSURL.URLByStandardizingPath', + 'NSURL.pathExtension', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_URLByStandardizingPath, - ); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_pathExtension); + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } - /// URLByResolvingSymlinksInPath - objc.NSURL? get URLByResolvingSymlinksInPath { + /// The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do. + static objc.NSURL? fileURLWithPathComponents(objc.NSArray components) { objc.checkOsVersionInternal( - 'NSURL.URLByResolvingSymlinksInPath', + 'NSURL.fileURLWithPathComponents:', iOS: (false, (4, 0, 0)), macOS: (false, (10, 6, 0)), ); - final _ret = _objc_msgSend_151sglz( - this.ref.pointer, - _sel_URLByResolvingSymlinksInPath, + final $ret = _objc_msgSend_1sotr3r( + _class_NSURL, + _sel_fileURLWithPathComponents_, + components.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSURL.fromPointer($ret, retain: true, release: true); } } @@ -95551,24 +96074,28 @@ extension NSURLClient on objc.NSObject { macOS: (false, (10, 0, 0)), ); _objc_msgSend_pfv6jd( - this.ref.pointer, + object$.ref.pointer, _sel_URL_resourceDataDidBecomeAvailable_, sender.ref.pointer, resourceDataDidBecomeAvailable.ref.pointer, ); } - /// URLResourceDidFinishLoading: - void URLResourceDidFinishLoading(objc.NSURL sender) { + /// URL:resourceDidFailLoadingWithReason: + void URL$1( + objc.NSURL sender, { + required objc.NSString resourceDidFailLoadingWithReason, + }) { objc.checkOsVersionInternal( - 'NSObject.URLResourceDidFinishLoading:', + 'NSObject.URL:resourceDidFailLoadingWithReason:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - _objc_msgSend_xtuoz7( - this.ref.pointer, - _sel_URLResourceDidFinishLoading_, + _objc_msgSend_pfv6jd( + object$.ref.pointer, + _sel_URL_resourceDidFailLoadingWithReason_, sender.ref.pointer, + resourceDidFailLoadingWithReason.ref.pointer, ); } @@ -95580,27 +96107,23 @@ extension NSURLClient on objc.NSObject { macOS: (false, (10, 0, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, + object$.ref.pointer, _sel_URLResourceDidCancelLoading_, sender.ref.pointer, ); } - /// URL:resourceDidFailLoadingWithReason: - void URL$1( - objc.NSURL sender, { - required objc.NSString resourceDidFailLoadingWithReason, - }) { + /// URLResourceDidFinishLoading: + void URLResourceDidFinishLoading(objc.NSURL sender) { objc.checkOsVersionInternal( - 'NSObject.URL:resourceDidFailLoadingWithReason:', + 'NSObject.URLResourceDidFinishLoading:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - _objc_msgSend_pfv6jd( - this.ref.pointer, - _sel_URL_resourceDidFailLoadingWithReason_, + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_URLResourceDidFinishLoading_, sender.ref.pointer, - resourceDidFailLoadingWithReason.ref.pointer, ); } } @@ -95611,16 +96134,16 @@ late final _sel_resourceDataUsingCache_ = objc.registerName( final _objc_msgSend_1t6aok9 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Bool, ) > >() .asFunction< - ffi.Pointer Function( - ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool, ) @@ -95635,19 +96158,19 @@ final _objc_msgSend_1lsax7n = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ) >(); late final _sel_URLHandleUsingCache_ = objc.registerName( @@ -95656,26 +96179,26 @@ late final _sel_URLHandleUsingCache_ = objc.registerName( /// NSURLLoading extension NSURLLoading on objc.NSURL { - /// Blocks to load the data if necessary. If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be returned immediately. If shouldUseCache is NO, a new load will be started - objc.NSData? resourceDataUsingCache(bool shouldUseCache) { + /// Sophisticated clients will want to ask for this, then message the handle directly. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded + objc.NSURLHandle? URLHandleUsingCache(bool shouldUseCache) { objc.checkOsVersionInternal( - 'NSURL.resourceDataUsingCache:', + 'NSURL.URLHandleUsingCache:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1t6aok9( - this.ref.pointer, - _sel_resourceDataUsingCache_, + final $ret = _objc_msgSend_1t6aok9( + object$.ref.pointer, + _sel_URLHandleUsingCache_, shouldUseCache, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); + : objc.NSURLHandle.fromPointer($ret, retain: true, release: true); } /// Starts an asynchronous load of the data, registering delegate to receive notification. Only one such background load can proceed at a time. void loadResourceDataNotifyingClient( - objc.ObjCObjectBase client, { + objc.ObjCObject client, { required bool usingCache, }) { objc.checkOsVersionInternal( @@ -95684,7 +96207,7 @@ extension NSURLLoading on objc.NSURL { macOS: (false, (10, 0, 0)), ); _objc_msgSend_6p7ndb( - this.ref.pointer, + object$.ref.pointer, _sel_loadResourceDataNotifyingClient_usingCache_, client.ref.pointer, usingCache, @@ -95692,69 +96215,66 @@ extension NSURLLoading on objc.NSURL { } /// propertyForKey: - objc.ObjCObjectBase? propertyForKey(objc.NSString propertyKey) { + objc.ObjCObject? propertyForKey(objc.NSString propertyKey) { objc.checkOsVersionInternal( 'NSURL.propertyForKey:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1sotr3r( - this.ref.pointer, + final $ret = _objc_msgSend_1sotr3r( + object$.ref.pointer, _sel_propertyForKey_, propertyKey.ref.pointer, ); - return _ret.address == 0 + return $ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.ObjCObject($ret, retain: true, release: true); } - /// These attempt to write the given arguments for the resource specified by the URL; they return success or failure - bool setResourceData(objc.NSData data) { + /// Blocks to load the data if necessary. If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be returned immediately. If shouldUseCache is NO, a new load will be started + objc.NSData? resourceDataUsingCache(bool shouldUseCache) { objc.checkOsVersionInternal( - 'NSURL.setResourceData:', + 'NSURL.resourceDataUsingCache:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - return _objc_msgSend_19nvye5( - this.ref.pointer, - _sel_setResourceData_, - data.ref.pointer, + final $ret = _objc_msgSend_1t6aok9( + object$.ref.pointer, + _sel_resourceDataUsingCache_, + shouldUseCache, ); + return $ret.address == 0 + ? null + : objc.NSData.fromPointer($ret, retain: true, release: true); } /// setProperty:forKey: - bool setProperty( - objc.ObjCObjectBase property, { - required objc.NSString forKey, - }) { + bool setProperty(objc.ObjCObject property, {required objc.NSString forKey}) { objc.checkOsVersionInternal( 'NSURL.setProperty:forKey:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); return _objc_msgSend_1lsax7n( - this.ref.pointer, + object$.ref.pointer, _sel_setProperty_forKey_, property.ref.pointer, forKey.ref.pointer, ); } - /// Sophisticated clients will want to ask for this, then message the handle directly. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded - objc.NSURLHandle? URLHandleUsingCache(bool shouldUseCache) { + /// These attempt to write the given arguments for the resource specified by the URL; they return success or failure + bool setResourceData(objc.NSData data) { objc.checkOsVersionInternal( - 'NSURL.URLHandleUsingCache:', + 'NSURL.setResourceData:', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0)), ); - final _ret = _objc_msgSend_1t6aok9( - this.ref.pointer, - _sel_URLHandleUsingCache_, - shouldUseCache, + return _objc_msgSend_19nvye5( + object$.ref.pointer, + _sel_setResourceData_, + data.ref.pointer, ); - return _ret.address == 0 - ? null - : objc.NSURLHandle.castFromPointer(_ret, retain: true, release: true); } } @@ -95762,23 +96282,17 @@ extension NSURLLoading on objc.NSURL { /// NSLocking in your config's objc-protocols list. /// /// NSLocking -interface class NSLocking extends objc.ObjCProtocolBase { - NSLocking._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super(pointer, retain: retain, release: release); - +extension type NSLocking._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [NSLocking] that points to the same underlying object as [other]. - NSLocking.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSLocking.as(objc.ObjCObject other) : object$ = other; /// Constructs a [NSLocking] that wraps the given raw object pointer. - NSLocking.castFromPointer( - ffi.Pointer other, { + NSLocking.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } late final _class_NSCondition = objc.getClass("NSCondition"); @@ -95787,104 +96301,11 @@ late final _sel_waitUntilDate_ = objc.registerName("waitUntilDate:"); late final _sel_signal = objc.registerName("signal"); late final _sel_broadcast = objc.registerName("broadcast"); late final _sel_lock = objc.registerName("lock"); -void _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => block.ref.target - .cast arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_ObjCBlock_ffiVoid_ffiVoid_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, -) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Pointer) -> -_ObjCBlock_ffiVoid_ffiVoid_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline) - ..keepIsolateAlive = false; -void _ObjCBlock_ffiVoid_ffiVoid_blockingTrampoline( - ffi.Pointer block, - ffi.Pointer waiter, - ffi.Pointer arg0, -) { - try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); - } catch (e) { - } finally { - objc.signalWaiter(waiter); - objc.objectRelease(block.cast()); - } -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_blockingCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.isolateLocal(_ObjCBlock_ffiVoid_ffiVoid_blockingTrampoline) - ..keepIsolateAlive = false; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) -> -_ObjCBlock_ffiVoid_ffiVoid_blockingListenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >.listener(_ObjCBlock_ffiVoid_ffiVoid_blockingTrampoline) - ..keepIsolateAlive = false; /// Construction methods for `objc.ObjCBlock)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer( + static objc.ObjCBlock)> fromPointer( ffi.Pointer pointer, { bool retain = false, bool release = false, @@ -95906,7 +96327,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { > ptr, ) => objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable, ptr.cast()), + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), retain: false, release: true, ); @@ -95924,7 +96345,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { bool keepIsolateAlive = true, }) => objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_closureCallable, + _closureCallable, (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive, ), @@ -95946,7 +96367,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), + _listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive, ); @@ -95974,12 +96395,12 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { bool keepIsolateAlive = true, }) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_blockingCallable.nativeFunction.cast(), + _blockingCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive, ); final rawListener = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_blockingListenerCallable.nativeFunction.cast(), + _blockingListenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0), keepIsolateAlive, ); @@ -95996,10 +96417,106 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { release: true, ); } + + static void _listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); + } + + static ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Pointer) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; + static void _blockingTrampoline( + ffi.Pointer block, + ffi.Pointer waiter, + ffi.Pointer arg0, + ) { + try { + (objc.getBlockClosure(block) as void Function(ffi.Pointer))( + arg0, + ); + } catch (e) { + } finally { + objc.signalWaiter(waiter); + objc.objectRelease(block.cast()); + } + } + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => block.ref.target + .cast arg0)>>() + .asFunction)>()(arg0); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ) => (objc.getBlockClosure(block) as void Function(ffi.Pointer))( + arg0, + ); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_CallExtension +extension ObjCBlock_ffiVoid_ffiVoid$CallExtension on objc.ObjCBlock)> { void call(ffi.Pointer arg0) => ref.pointer.ref.invoke .cast< @@ -96018,81 +96535,93 @@ extension ObjCBlock_ffiVoid_ffiVoid_CallExtension late final _sel_unlock = objc.registerName("unlock"); /// NSCondition -class NSCondition extends objc.NSObject implements NSLocking { - NSCondition._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release) { +extension type NSCondition._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject, NSLocking { + /// Constructs a [NSCondition] that points to the same underlying object as [other]. + NSCondition.as(objc.ObjCObject other) : object$ = other { objc.checkOsVersionInternal( 'NSCondition', iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0)), ); + assert(isA(object$)); } - /// Constructs a [NSCondition] that points to the same underlying object as [other]. - NSCondition.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSCondition] that wraps the given raw object pointer. - NSCondition.castFromPointer( - ffi.Pointer other, { + NSCondition.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'NSCondition', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + assert(isA(object$)); + } /// Returns whether [obj] is an instance of [NSCondition]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_NSCondition, + ); + + /// alloc + static NSCondition alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSCondition, _sel_alloc); + return NSCondition.fromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSCondition allocWithZone(ffi.Pointer zone) { + final $ret = _objc_msgSend_1cwp428( _class_NSCondition, + _sel_allocWithZone_, + zone, ); + return NSCondition.fromPointer($ret, retain: false, release: true); } - /// wait - void wait$1() { - objc.checkOsVersionInternal( - 'NSCondition.wait', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_wait); + /// new + static NSCondition new$() { + final $ret = _objc_msgSend_151sglz(_class_NSCondition, _sel_new); + return NSCondition.fromPointer($ret, retain: false, release: true); } - /// waitUntilDate: - bool waitUntilDate(objc.NSDate limit) { + /// Returns a new instance of NSCondition constructed with the default `new` method. + NSCondition() : this.as(new$().object$); +} + +extension NSCondition$Methods on NSCondition { + /// broadcast + void broadcast() { objc.checkOsVersionInternal( - 'NSCondition.waitUntilDate:', + 'NSCondition.broadcast', iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0)), ); - return _objc_msgSend_19nvye5( - this.ref.pointer, - _sel_waitUntilDate_, - limit.ref.pointer, - ); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_broadcast); } - /// signal - void signal() { + /// init + NSCondition init() { objc.checkOsVersionInternal( - 'NSCondition.signal', + 'NSCondition.init', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_signal); + return NSCondition.fromPointer($ret, retain: false, release: true); } - /// broadcast - void broadcast() { - objc.checkOsVersionInternal( - 'NSCondition.broadcast', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 5, 0)), - ); - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_broadcast); + /// lock + void lock() { + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_lock); } /// name @@ -96102,10 +96631,10 @@ class NSCondition extends objc.NSObject implements NSLocking { iOS: (false, (2, 0, 0)), macOS: (false, (10, 5, 0)), ); - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_name); - return _ret.address == 0 + final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_name); + return $ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + : objc.NSString.fromPointer($ret, retain: true, release: true); } /// setName: @@ -96116,85 +96645,57 @@ class NSCondition extends objc.NSObject implements NSLocking { macOS: (false, (10, 5, 0)), ); _objc_msgSend_xtuoz7( - this.ref.pointer, + object$.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr, ); } - /// init - NSCondition init() { + /// signal + void signal$1() { objc.checkOsVersionInternal( - 'NSCondition.init', + 'NSCondition.signal', iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final _ret = _objc_msgSend_151sglz( - this.ref.retainAndReturnPointer(), - _sel_init, + macOS: (false, (10, 5, 0)), ); - return NSCondition.castFromPointer(_ret, retain: false, release: true); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_signal); } - /// new - static NSCondition new$() { - final _ret = _objc_msgSend_151sglz(_class_NSCondition, _sel_new); - return NSCondition.castFromPointer(_ret, retain: false, release: true); + /// unlock + void unlock() { + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_unlock); } - /// allocWithZone: - static NSCondition allocWithZone(ffi.Pointer zone) { - final _ret = _objc_msgSend_1cwp428( - _class_NSCondition, - _sel_allocWithZone_, - zone, + /// wait + void wait$2() { + objc.checkOsVersionInternal( + 'NSCondition.wait', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), ); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSCondition alloc() { - final _ret = _objc_msgSend_151sglz(_class_NSCondition, _sel_alloc); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } - - /// self - NSCondition self$1() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSCondition.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSCondition retain() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSCondition.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSCondition autorelease() { - final _ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSCondition.castFromPointer(_ret, retain: true, release: true); - } - - /// lock - void lock() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_lock); + _objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_wait); } - /// unlock - void unlock() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_unlock); + /// waitUntilDate: + bool waitUntilDate(objc.NSDate limit) { + objc.checkOsVersionInternal( + 'NSCondition.waitUntilDate:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + return _objc_msgSend_19nvye5( + object$.ref.pointer, + _sel_waitUntilDate_, + limit.ref.pointer, + ); } - - /// Returns a new instance of NSCondition constructed with the default `new` method. - factory NSCondition() => new$(); } -typedef NSProgressKind$1 = ffi.Pointer; +typedef NSProgressKind$1 = ffi.Pointer; typedef DartNSProgressKind$1 = objc.NSString; -typedef NSProgressUserInfoKey$1 = ffi.Pointer; +typedef NSProgressUserInfoKey$1 = ffi.Pointer; typedef DartNSProgressUserInfoKey$1 = objc.NSString; -typedef NSProgressFileOperationKind$1 = ffi.Pointer; +typedef NSProgressFileOperationKind$1 = ffi.Pointer; typedef DartNSProgressFileOperationKind$1 = objc.NSString; typedef NSProgressUnpublishingHandler$1 = ffi.Pointer; typedef DartNSProgressUnpublishingHandler$1 = @@ -96209,24 +96710,21 @@ typedef DartNSProgressPublishingHandler$1 = /// NSException in your config's objc-interfaces list. /// /// NSException -class NSException extends objc.NSObject - implements objc.NSCopying, objc.NSSecureCoding { - NSException._( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) : super.castFromPointer(pointer, retain: retain, release: release); - +extension type NSException._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSCopying, + objc.NSSecureCoding { /// Constructs a [NSException] that points to the same underlying object as [other]. - NSException.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + NSException.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [NSException] that wraps the given raw object pointer. - NSException.castFromPointer( - ffi.Pointer other, { + NSException.fromPointer( + ffi.Pointer other, { bool retain = false, bool release = false, - }) : this._(other, retain: retain, release: release); + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } late final _class_NSException = objc.getClass("NSException"); @@ -96235,7 +96733,10 @@ late final _sel_raise_format_ = objc.registerName("raise:format:"); /// NSExceptionRaisingConveniences extension NSExceptionRaisingConveniences on NSException { /// raise:format: - static void raise(DartNSExceptionName name, {required objc.NSString format}) { + static void raise$1( + DartNSExceptionName name, { + required objc.NSString format, + }) { _objc_msgSend_pfv6jd( _class_NSException, _sel_raise_format_, @@ -96247,7 +96748,7 @@ extension NSExceptionRaisingConveniences on NSException { typedef NSUncaughtExceptionHandler = ffi.NativeFunction< - ffi.Void Function(ffi.Pointer exception) + ffi.Void Function(ffi.Pointer exception) >; enum NSOperationQueuePriority { @@ -96272,9 +96773,9 @@ enum NSOperationQueuePriority { }; } -typedef NSErrorDomain = ffi.Pointer; +typedef NSErrorDomain = ffi.Pointer; typedef DartNSErrorDomain = objc.NSString; -typedef NSErrorUserInfoKey = ffi.Pointer; +typedef NSErrorUserInfoKey = ffi.Pointer; typedef DartNSErrorUserInfoKey = objc.NSString; late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_ = objc.registerName( @@ -96284,11 +96785,11 @@ final _objc_msgSend_10txwc9 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -96296,11 +96797,11 @@ final _objc_msgSend_10txwc9 = objc.msgSendPointer >() .asFunction< void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ) @@ -96312,33 +96813,51 @@ final _objc_msgSend_z7gxsm = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong, ) > >() .asFunction< bool Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ) >(); /// NSErrorRecoveryAttempting extension NSErrorRecoveryAttempting on objc.NSObject { + /// Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options. + bool attemptRecoveryFromError( + objc.NSError error, { + required DartNSUInteger optionIndex, + }) { + objc.checkOsVersionInternal( + 'NSObject.attemptRecoveryFromError:optionIndex:', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + return _objc_msgSend_z7gxsm( + object$.ref.pointer, + _sel_attemptRecoveryFromError_optionIndex_, + error.ref.pointer, + optionIndex, + ); + } + /// Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: /// /// - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; /// /// The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. - void attemptRecoveryFromError( + void attemptRecoveryFromError$1( objc.NSError error, { required DartNSUInteger optionIndex, - objc.ObjCObjectBase? delegate, + objc.ObjCObject? delegate, required ffi.Pointer didRecoverSelector, required ffi.Pointer contextInfo, }) { @@ -96348,7 +96867,7 @@ extension NSErrorRecoveryAttempting on objc.NSObject { macOS: (false, (10, 0, 0)), ); _objc_msgSend_10txwc9( - this.ref.pointer, + object$.ref.pointer, _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_, error.ref.pointer, optionIndex, @@ -96357,131 +96876,113 @@ extension NSErrorRecoveryAttempting on objc.NSObject { contextInfo, ); } - - /// Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options. - bool attemptRecoveryFromError$1( - objc.NSError error, { - required DartNSUInteger optionIndex, - }) { - objc.checkOsVersionInternal( - 'NSObject.attemptRecoveryFromError:optionIndex:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - return _objc_msgSend_z7gxsm( - this.ref.pointer, - _sel_attemptRecoveryFromError_optionIndex_, - error.ref.pointer, - optionIndex, - ); - } } -const int noErr = 0; +const int noErr$1 = 0; -const int kNilOptions = 0; +const int kNilOptions$9 = 0; const int kVariableLengthArray = 1; -const int kUnknownType = 1061109567; +const int kUnknownType$6 = 1061109567; -const int normal = 0; +const int normal$3 = 0; -const int bold = 1; +const int bold$7 = 1; -const int italic = 2; +const int italic$7 = 2; -const int underline = 4; +const int underline$5 = 4; -const int outline = 8; +const int outline$4 = 8; -const int shadow = 16; +const int shadow$1 = 16; -const int condense = 32; +const int condense$2 = 32; -const int extend = 64; +const int extend$7 = 64; -const int developStage = 32; +const int developStage$9 = 32; -const int alphaStage = 64; +const int alphaStage$3 = 64; -const int betaStage = 96; +const int betaStage$9 = 96; -const int finalStage = 128; +const int finalStage$8 = 128; -const int NSScannedOption = 1; +const int NSScannedOption$2 = 1; const int NSCollectorDisabledOption = 2; -const int noErr$1 = 0; +const int noErr$10 = 0; -const int kNilOptions$1 = 0; +const int kNilOptions$7 = 0; -const int kVariableLengthArray$1 = 1; +const int kVariableLengthArray$9 = 1; const int kUnknownType$1 = 1061109567; -const int normal$1 = 0; +const int normal$4 = 0; -const int bold$1 = 1; +const int bold$8 = 1; -const int italic$1 = 2; +const int italic$8 = 2; -const int underline$1 = 4; +const int underline$10 = 4; -const int outline$1 = 8; +const int outline$6 = 8; -const int shadow$1 = 16; +const int shadow = 16; -const int condense$1 = 32; +const int condense$4 = 32; -const int extend$1 = 64; +const int extend$8 = 64; -const int developStage$1 = 32; +const int developStage$7 = 32; -const int alphaStage$1 = 64; +const int alphaStage$2 = 64; -const int betaStage$1 = 96; +const int betaStage$4 = 96; -const int finalStage$1 = 128; +const int finalStage$5 = 128; -const int NSScannedOption$1 = 1; +const int NSScannedOption$9 = 1; const int NSCollectorDisabledOption$1 = 2; -const int noErr$2 = 0; +const int noErr$5 = 0; -const int kNilOptions$2 = 0; +const int kNilOptions$1 = 0; -const int kVariableLengthArray$2 = 1; +const int kVariableLengthArray$5 = 1; -const int kUnknownType$2 = 1061109567; +const int kUnknownType$4 = 1061109567; -const int normal$2 = 0; +const int normal$9 = 0; -const int bold$2 = 1; +const int bold$1 = 1; -const int italic$2 = 2; +const int italic$6 = 2; const int underline$2 = 4; -const int outline$2 = 8; +const int outline = 8; -const int shadow$2 = 16; +const int shadow$9 = 16; -const int condense$2 = 32; +const int condense$7 = 32; -const int extend$2 = 64; +const int extend$1 = 64; -const int developStage$2 = 32; +const int developStage$8 = 32; -const int alphaStage$2 = 64; +const int alphaStage$9 = 64; -const int betaStage$2 = 96; +const int betaStage$8 = 96; const int finalStage$2 = 128; -const int NSScannedOption$2 = 1; +const int NSScannedOption$7 = 1; const int NSCollectorDisabledOption$2 = 2; @@ -100635,6 +101136,8 @@ const int CSSM_APPLE_PRIVATE_CSPDL_CODE_26 = 26; const int CSSM_APPLE_PRIVATE_CSPDL_CODE_27 = 27; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_28 = 28; + const int CSSM_APPLECSP_KEYDIGEST = 256; const int CSSM_APPLECSP_PUBKEY = 257; @@ -101107,45 +101610,45 @@ const int SSL_RSA_WITH_3DES_EDE_CBC_MD5 = -125; const int SSL_NO_SUCH_CIPHERSUITE = -1; -const int noErr$3 = 0; +const int noErr = 0; -const int kNilOptions$3 = 0; +const int kNilOptions$4 = 0; -const int kVariableLengthArray$3 = 1; +const int kVariableLengthArray$1 = 1; -const int kUnknownType$3 = 1061109567; +const int kUnknownType$9 = 1061109567; -const int normal$3 = 0; +const int normal = 0; -const int bold$3 = 1; +const int bold$5 = 1; -const int italic$3 = 2; +const int italic$5 = 2; -const int underline$3 = 4; +const int underline$6 = 4; -const int outline$3 = 8; +const int outline$9 = 8; -const int shadow$3 = 16; +const int shadow$8 = 16; -const int condense$3 = 32; +const int condense = 32; -const int extend$3 = 64; +const int extend$4 = 64; -const int developStage$3 = 32; +const int developStage$2 = 32; -const int alphaStage$3 = 64; +const int alphaStage$6 = 64; const int betaStage$3 = 96; -const int finalStage$3 = 128; +const int finalStage$10 = 128; -const int NSScannedOption$3 = 1; +const int NSScannedOption$10 = 1; -const int NSCollectorDisabledOption$3 = 2; +const int NSCollectorDisabledOption$10 = 2; -const int NSASCIIStringEncoding = 1; +const int NSASCIIStringEncoding$1 = 1; -const int NSNEXTSTEPStringEncoding = 2; +const int NSNEXTSTEPStringEncoding$1 = 2; const int NSJapaneseEUCStringEncoding = 3; @@ -101153,35 +101656,35 @@ const int NSUTF8StringEncoding = 4; const int NSISOLatin1StringEncoding = 5; -const int NSSymbolStringEncoding = 6; +const int NSSymbolStringEncoding$1 = 6; const int NSNonLossyASCIIStringEncoding = 7; -const int NSShiftJISStringEncoding = 8; +const int NSShiftJISStringEncoding$1 = 8; const int NSISOLatin2StringEncoding = 9; -const int NSUnicodeStringEncoding = 10; +const int NSUnicodeStringEncoding$1 = 10; -const int NSWindowsCP1251StringEncoding = 11; +const int NSWindowsCP1251StringEncoding$1 = 11; -const int NSWindowsCP1252StringEncoding = 12; +const int NSWindowsCP1252StringEncoding$1 = 12; -const int NSWindowsCP1253StringEncoding = 13; +const int NSWindowsCP1253StringEncoding$1 = 13; -const int NSWindowsCP1254StringEncoding = 14; +const int NSWindowsCP1254StringEncoding$1 = 14; -const int NSWindowsCP1250StringEncoding = 15; +const int NSWindowsCP1250StringEncoding$1 = 15; const int NSISO2022JPStringEncoding = 21; const int NSMacOSRomanStringEncoding = 30; -const int NSUTF16StringEncoding = 10; +const int NSUTF16StringEncoding$1 = 10; const int NSUTF16BigEndianStringEncoding = 2415919360; -const int NSUTF16LittleEndianStringEncoding = 2483028224; +const int NSUTF16LittleEndianStringEncoding$1 = 2483028224; const int NSUTF32StringEncoding = 2348810496; @@ -101193,189 +101696,189 @@ const int NSProprietaryStringEncoding = 65536; const int NSOpenStepUnicodeReservedBase = 62464; -const int noErr$4 = 0; +const int noErr$3 = 0; -const int kNilOptions$4 = 0; +const int kNilOptions$5 = 0; -const int kVariableLengthArray$4 = 1; +const int kVariableLengthArray$7 = 1; -const int kUnknownType$4 = 1061109567; +const int kUnknownType$10 = 1061109567; -const int normal$4 = 0; +const int normal$2 = 0; -const int bold$4 = 1; +const int bold = 1; -const int italic$4 = 2; +const int italic$3 = 2; -const int underline$4 = 4; +const int underline$9 = 4; -const int outline$4 = 8; +const int outline$7 = 8; -const int shadow$4 = 16; +const int shadow$7 = 16; -const int condense$4 = 32; +const int condense$3 = 32; -const int extend$4 = 64; +const int extend$2 = 64; const int developStage$4 = 32; -const int alphaStage$4 = 64; +const int alphaStage$7 = 64; -const int betaStage$4 = 96; +const int betaStage = 96; -const int finalStage$4 = 128; +const int finalStage$9 = 128; -const int NSScannedOption$4 = 1; +const int NSScannedOption$1 = 1; -const int NSCollectorDisabledOption$4 = 2; +const int NSCollectorDisabledOption$3 = 2; -const int noErr$5 = 0; +const int noErr$4 = 0; -const int kNilOptions$5 = 0; +const int kNilOptions$8 = 0; -const int kVariableLengthArray$5 = 1; +const int kVariableLengthArray$3 = 1; -const int kUnknownType$5 = 1061109567; +const int kUnknownType$8 = 1061109567; -const int normal$5 = 0; +const int normal$6 = 0; -const int bold$5 = 1; +const int bold$10 = 1; -const int italic$5 = 2; +const int italic$1 = 2; -const int underline$5 = 4; +const int underline$7 = 4; -const int outline$5 = 8; +const int outline$3 = 8; const int shadow$5 = 16; -const int condense$5 = 32; +const int condense$9 = 32; -const int extend$5 = 64; +const int extend = 64; const int developStage$5 = 32; -const int alphaStage$5 = 64; +const int alphaStage$8 = 64; -const int betaStage$5 = 96; +const int betaStage$1 = 96; -const int finalStage$5 = 128; +const int finalStage$1 = 128; -const int NSScannedOption$5 = 1; +const int NSScannedOption$6 = 1; -const int NSCollectorDisabledOption$5 = 2; +const int NSCollectorDisabledOption$4 = 2; -const int noErr$6 = 0; +const int noErr$7 = 0; -const int kNilOptions$6 = 0; +const int kNilOptions$10 = 0; -const int kVariableLengthArray$6 = 1; +const int kVariableLengthArray$10 = 1; -const int kUnknownType$6 = 1061109567; +const int kUnknownType$7 = 1061109567; -const int normal$6 = 0; +const int normal$8 = 0; -const int bold$6 = 1; +const int bold$3 = 1; -const int italic$6 = 2; +const int italic$2 = 2; -const int underline$6 = 4; +const int underline$4 = 4; -const int outline$6 = 8; +const int outline$1 = 8; const int shadow$6 = 16; const int condense$6 = 32; -const int extend$6 = 64; +const int extend$3 = 64; -const int developStage$6 = 32; +const int developStage$10 = 32; -const int alphaStage$6 = 64; +const int alphaStage$1 = 64; const int betaStage$6 = 96; -const int finalStage$6 = 128; +const int finalStage$7 = 128; -const int NSScannedOption$6 = 1; +const int NSScannedOption = 1; -const int NSCollectorDisabledOption$6 = 2; +const int NSCollectorDisabledOption$5 = 2; -const int noErr$7 = 0; +const int noErr$8 = 0; -const int kNilOptions$7 = 0; +const int kNilOptions$3 = 0; -const int kVariableLengthArray$7 = 1; +const int kVariableLengthArray$4 = 1; -const int kUnknownType$7 = 1061109567; +const int kUnknownType$5 = 1061109567; const int normal$7 = 0; -const int bold$7 = 1; +const int bold$6 = 1; -const int italic$7 = 2; +const int italic$10 = 2; -const int underline$7 = 4; +const int underline$1 = 4; -const int outline$7 = 8; +const int outline$5 = 8; -const int shadow$7 = 16; +const int shadow$3 = 16; -const int condense$7 = 32; +const int condense$1 = 32; -const int extend$7 = 64; +const int extend$6 = 64; -const int developStage$7 = 32; +const int developStage$1 = 32; -const int alphaStage$7 = 64; +const int alphaStage$4 = 64; -const int betaStage$7 = 96; +const int betaStage$2 = 96; -const int finalStage$7 = 128; +const int finalStage = 128; -const int NSScannedOption$7 = 1; +const int NSScannedOption$8 = 1; -const int NSCollectorDisabledOption$7 = 2; +const int NSCollectorDisabledOption$6 = 2; -const int noErr$8 = 0; +const int noErr$2 = 0; -const int kNilOptions$8 = 0; +const int kNilOptions$2 = 0; const int kVariableLengthArray$8 = 1; -const int kUnknownType$8 = 1061109567; +const int kUnknownType$2 = 1061109567; -const int normal$8 = 0; +const int normal$1 = 0; -const int bold$8 = 1; +const int bold$4 = 1; -const int italic$8 = 2; +const int italic$9 = 2; -const int underline$8 = 4; +const int underline = 4; -const int outline$8 = 8; +const int outline$10 = 8; -const int shadow$8 = 16; +const int shadow$4 = 16; -const int condense$8 = 32; +const int condense$5 = 32; -const int extend$8 = 64; +const int extend$9 = 64; -const int developStage$8 = 32; +const int developStage = 32; -const int alphaStage$8 = 64; +const int alphaStage = 64; -const int betaStage$8 = 96; +const int betaStage$10 = 96; -const int finalStage$8 = 128; +const int finalStage$4 = 128; -const int NSScannedOption$8 = 1; +const int NSScannedOption$4 = 1; -const int NSCollectorDisabledOption$8 = 2; +const int NSCollectorDisabledOption$7 = 2; -const int NSASCIIStringEncoding$1 = 1; +const int NSASCIIStringEncoding = 1; -const int NSNEXTSTEPStringEncoding$1 = 2; +const int NSNEXTSTEPStringEncoding = 2; const int NSJapaneseEUCStringEncoding$1 = 3; @@ -101383,35 +101886,35 @@ const int NSUTF8StringEncoding$1 = 4; const int NSISOLatin1StringEncoding$1 = 5; -const int NSSymbolStringEncoding$1 = 6; +const int NSSymbolStringEncoding = 6; const int NSNonLossyASCIIStringEncoding$1 = 7; -const int NSShiftJISStringEncoding$1 = 8; +const int NSShiftJISStringEncoding = 8; const int NSISOLatin2StringEncoding$1 = 9; -const int NSUnicodeStringEncoding$1 = 10; +const int NSUnicodeStringEncoding = 10; -const int NSWindowsCP1251StringEncoding$1 = 11; +const int NSWindowsCP1251StringEncoding = 11; -const int NSWindowsCP1252StringEncoding$1 = 12; +const int NSWindowsCP1252StringEncoding = 12; -const int NSWindowsCP1253StringEncoding$1 = 13; +const int NSWindowsCP1253StringEncoding = 13; -const int NSWindowsCP1254StringEncoding$1 = 14; +const int NSWindowsCP1254StringEncoding = 14; -const int NSWindowsCP1250StringEncoding$1 = 15; +const int NSWindowsCP1250StringEncoding = 15; const int NSISO2022JPStringEncoding$1 = 21; const int NSMacOSRomanStringEncoding$1 = 30; -const int NSUTF16StringEncoding$1 = 10; +const int NSUTF16StringEncoding = 10; const int NSUTF16BigEndianStringEncoding$1 = 2415919360; -const int NSUTF16LittleEndianStringEncoding$1 = 2483028224; +const int NSUTF16LittleEndianStringEncoding = 2483028224; const int NSUTF32StringEncoding$1 = 2348810496; @@ -101425,75 +101928,75 @@ const int DISPATCH_WALLTIME_NOW$1 = -2; const int noErr$9 = 0; -const int kNilOptions$9 = 0; +const int kNilOptions$6 = 0; -const int kVariableLengthArray$9 = 1; +const int kVariableLengthArray$6 = 1; -const int kUnknownType$9 = 1061109567; +const int kUnknownType = 1061109567; -const int normal$9 = 0; +const int normal$10 = 0; const int bold$9 = 1; -const int italic$9 = 2; +const int italic = 2; -const int underline$9 = 4; +const int underline$3 = 4; -const int outline$9 = 8; +const int outline$2 = 8; -const int shadow$9 = 16; +const int shadow$10 = 16; -const int condense$9 = 32; +const int condense$10 = 32; -const int extend$9 = 64; +const int extend$10 = 64; -const int developStage$9 = 32; +const int developStage$3 = 32; -const int alphaStage$9 = 64; +const int alphaStage$10 = 64; -const int betaStage$9 = 96; +const int betaStage$5 = 96; -const int finalStage$9 = 128; +const int finalStage$3 = 128; -const int NSScannedOption$9 = 1; +const int NSScannedOption$5 = 1; -const int NSCollectorDisabledOption$9 = 2; +const int NSCollectorDisabledOption$8 = 2; -const int noErr$10 = 0; +const int noErr$6 = 0; -const int kNilOptions$10 = 0; +const int kNilOptions = 0; -const int kVariableLengthArray$10 = 1; +const int kVariableLengthArray$2 = 1; -const int kUnknownType$10 = 1061109567; +const int kUnknownType$3 = 1061109567; -const int normal$10 = 0; +const int normal$5 = 0; -const int bold$10 = 1; +const int bold$2 = 1; -const int italic$10 = 2; +const int italic$4 = 2; -const int underline$10 = 4; +const int underline$8 = 4; -const int outline$10 = 8; +const int outline$8 = 8; -const int shadow$10 = 16; +const int shadow$2 = 16; -const int condense$10 = 32; +const int condense$8 = 32; -const int extend$10 = 64; +const int extend$5 = 64; -const int developStage$10 = 32; +const int developStage$6 = 32; -const int alphaStage$10 = 64; +const int alphaStage$5 = 64; -const int betaStage$10 = 96; +const int betaStage$7 = 96; -const int finalStage$10 = 128; +const int finalStage$6 = 128; -const int NSScannedOption$10 = 1; +const int NSScannedOption$3 = 1; -const int NSCollectorDisabledOption$10 = 2; +const int NSCollectorDisabledOption$9 = 2; const int __API_TO_BE_DEPRECATED = 100000; @@ -101663,6 +102166,14 @@ const int __MAC_15_3 = 150300; const int __MAC_15_4 = 150400; +const int __MAC_15_5 = 150500; + +const int __MAC_15_6 = 150600; + +const int __MAC_16_0 = 160000; + +const int __MAC_26_0 = 260000; + const int __IPHONE_2_0 = 20000; const int __IPHONE_2_1 = 20100; @@ -101767,8 +102278,6 @@ const int __IPHONE_14_3 = 140300; const int __IPHONE_14_5 = 140500; -const int __IPHONE_14_4 = 140400; - const int __IPHONE_14_6 = 140600; const int __IPHONE_14_7 = 140700; @@ -101835,6 +102344,14 @@ const int __IPHONE_18_3 = 180300; const int __IPHONE_18_4 = 180400; +const int __IPHONE_18_5 = 180500; + +const int __IPHONE_18_6 = 180600; + +const int __IPHONE_19_0 = 190000; + +const int __IPHONE_26_0 = 260000; + const int __WATCHOS_1_0 = 10000; const int __WATCHOS_2_0 = 20000; @@ -101943,6 +102460,14 @@ const int __WATCHOS_11_3 = 110300; const int __WATCHOS_11_4 = 110400; +const int __WATCHOS_11_5 = 110500; + +const int __WATCHOS_11_6 = 110600; + +const int __WATCHOS_12_0 = 120000; + +const int __WATCHOS_26_0 = 260000; + const int __TVOS_9_0 = 90000; const int __TVOS_9_1 = 90100; @@ -102051,6 +102576,14 @@ const int __TVOS_18_3 = 180300; const int __TVOS_18_4 = 180400; +const int __TVOS_18_5 = 180500; + +const int __TVOS_18_6 = 180600; + +const int __TVOS_19_0 = 190000; + +const int __TVOS_26_0 = 260000; + const int __BRIDGEOS_2_0 = 20000; const int __BRIDGEOS_3_0 = 30000; @@ -102115,6 +102648,12 @@ const int __BRIDGEOS_9_3 = 90300; const int __BRIDGEOS_9_4 = 90400; +const int __BRIDGEOS_9_5 = 90500; + +const int __BRIDGEOS_9_6 = 90600; + +const int __BRIDGEOS_10_0 = 100000; + const int __DRIVERKIT_19_0 = 190000; const int __DRIVERKIT_20_0 = 200000; @@ -102153,6 +102692,12 @@ const int __DRIVERKIT_24_3 = 240300; const int __DRIVERKIT_24_4 = 240400; +const int __DRIVERKIT_24_5 = 240500; + +const int __DRIVERKIT_24_6 = 240600; + +const int __DRIVERKIT_25_0 = 250000; + const int __VISIONOS_1_0 = 10000; const int __VISIONOS_1_1 = 10100; @@ -102171,6 +102716,14 @@ const int __VISIONOS_2_3 = 20300; const int __VISIONOS_2_4 = 20400; +const int __VISIONOS_2_5 = 20500; + +const int __VISIONOS_2_6 = 20600; + +const int __VISIONOS_3_0 = 30000; + +const int __VISIONOS_26_0 = 260000; + const int MAC_OS_X_VERSION_10_0 = 1000; const int MAC_OS_X_VERSION_10_1 = 1010; @@ -102309,15 +102862,23 @@ const int MAC_OS_VERSION_15_3 = 150300; const int MAC_OS_VERSION_15_4 = 150400; +const int MAC_OS_VERSION_15_5 = 150500; + +const int MAC_OS_VERSION_15_6 = 150600; + +const int MAC_OS_VERSION_16_0 = 160000; + +const int MAC_OS_VERSION_26_0 = 260000; + const int __AVAILABILITY_VERSIONS_VERSION_HASH = 93585900; const String __AVAILABILITY_VERSIONS_VERSION_STRING = 'Local'; const String __AVAILABILITY_FILE = 'AvailabilityVersions.h'; -const int __MAC_OS_X_VERSION_MIN_REQUIRED = 150000; +const int __MAC_OS_X_VERSION_MIN_REQUIRED = 160000; -const int __MAC_OS_X_VERSION_MAX_ALLOWED = 150400; +const int __MAC_OS_X_VERSION_MAX_ALLOWED = 260000; const int __ENABLE_LEGACY_MAC_AVAILABILITY = 1; @@ -102471,6 +103032,8 @@ const int SIGEV_SIGNAL = 1; const int SIGEV_THREAD = 3; +const int SIGEV_KEVENT = 4; + const int ILL_NOOP = 0; const int ILL_ILLOPC = 1; @@ -102825,6 +103388,8 @@ const int IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES = 9; const int IOPOL_TYPE_VFS_DISALLOW_RW_FOR_O_EVTONLY = 10; +const int IOPOL_TYPE_VFS_ENTITLED_RESERVE_ACCESS = 14; + const int IOPOL_SCOPE_PROCESS = 0; const int IOPOL_SCOPE_THREAD = 1; @@ -102891,6 +103456,10 @@ const int IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT = 0; const int IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON = 1; +const int IOPOL_VFS_ENTITLED_RESERVE_ACCESS_OFF = 0; + +const int IOPOL_VFS_ENTITLED_RESERVE_ACCESS_ON = 1; + const int WNOHANG = 1; const int WUNTRACED = 2; @@ -102939,6 +103508,8 @@ const int EXIT_SUCCESS = 0; const int RAND_MAX = 2147483647; +const int _MALLOC_TYPE_MALLOC_BACKDEPLOY_PUBLIC = 1; + const int TARGET_OS_RTKIT = 0; const int TARGET_RT_LITTLE_ENDIAN = 1; @@ -103047,52 +103618,6 @@ const int QUAD_MAX = 9223372036854775807; const int QUAD_MIN = -9223372036854775808; -const int ARG_MAX = 1048576; - -const int CHILD_MAX = 266; - -const int GID_MAX = 2147483647; - -const int LINK_MAX = 32767; - -const int MAX_CANON = 1024; - -const int MAX_INPUT = 1024; - -const int NAME_MAX = 255; - -const int NGROUPS_MAX = 16; - -const int UID_MAX = 2147483647; - -const int OPEN_MAX = 10240; - -const int PATH_MAX = 1024; - -const int PIPE_BUF = 512; - -const int BC_BASE_MAX = 99; - -const int BC_DIM_MAX = 2048; - -const int BC_SCALE_MAX = 99; - -const int BC_STRING_MAX = 1000; - -const int CHARCLASS_NAME_MAX = 14; - -const int COLL_WEIGHTS_MAX = 2; - -const int EQUIV_CLASS_MAX = 2; - -const int EXPR_NEST_MAX = 32; - -const int LINE_MAX = 2048; - -const int RE_DUP_MAX = 255; - -const int NZERO = 20; - const int _POSIX_THREAD_KEYS_MAX = 128; const int API_TO_BE_DEPRECATED = 100000; @@ -103131,8 +103656,6 @@ const int SEEK_HOLE = 3; const int SEEK_DATA = 4; -const int L_ctermid = 1024; - const int MACH_PORT_NULL = 0; const int MACH_PORT_DEAD = 4294967295; @@ -103251,6 +103774,12 @@ const int MACH_SERVICE_PORT_INFO_STRING_NAME_MAX_BUF_LEN = 255; const int MACH_SERVICE_PORT_INFO_COUNT = 0; +const String MACH_PORT_CONNECTION_PORT_WITH_PORT_ARRAY = + 'com.apple.developer.allow-connection-port-with-port-array'; + +const String MACH_PORT_PROVISIONAL_REPLY_ENTITLEMENT = + 'com.apple.private.allow-weak-reply-port'; + const int MPO_CONTEXT_AS_GUARD = 1; const int MPO_QLIMIT = 2; @@ -103271,18 +103800,32 @@ const int MPO_FILTER_MSG = 256; const int MPO_TG_BLOCK_TRACKING = 512; +const int MPO_ENFORCE_REPLY_PORT_SEMANTICS = 8192; + +const int MPO_STRICT_SERVICE_PORT = 9216; + +const int MPO_OPTIONS_MASK = 9215; + +const int MPO_PORT_TYPE_MASK = 121856; + +const int MPO_PORT = 0; + const int MPO_SERVICE_PORT = 1024; const int MPO_CONNECTION_PORT = 2048; const int MPO_REPLY_PORT = 4096; -const int MPO_ENFORCE_REPLY_PORT_SEMANTICS = 8192; - const int MPO_PROVISIONAL_REPLY_PORT = 16384; const int MPO_EXCEPTION_PORT = 32768; +const int MPO_CONNECTION_PORT_WITH_PORT_ARRAY = 65536; + +const int MPO_UNUSED_BITS = -131072; + +const int MPO_ANONYMOUS_SERVICE = 4294967294; + const int GUARD_TYPE_MACH_PORT = 1; const int MAX_FATAL_kGUARD_EXC_CODE = 128; @@ -103291,25 +103834,57 @@ const int MAX_OPTIONAL_kGUARD_EXC_CODE = 524288; const int MPG_FLAGS_NONE = 0; -const int MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP = 72057594037927936; +const int MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER = 4; + +const int MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA = 16; + +const int MPG_FLAGS_MOD_REFS_PINNED_DEALLOC = 1; + +const int MPG_FLAGS_MOD_REFS_PINNED_DESTROY = 2; + +const int MPG_FLAGS_MOD_REFS_PINNED_COPYIN = 3; + +const int MPG_FLAGS_INVALID_RIGHT_RECV = 1; + +const int MPG_FLAGS_INVALID_RIGHT_DELTA = 2; + +const int MPG_FLAGS_INVALID_RIGHT_DESTRUCT = 3; + +const int MPG_FLAGS_INVALID_RIGHT_COPYIN = 4; -const int MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT = 144115188075855872; +const int MPG_FLAGS_INVALID_RIGHT_DEALLOC = 5; -const int MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER = 288230376151711744; +const int MPG_FLAGS_INVALID_RIGHT_DEALLOC_KERNEL = 6; -const int MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR = 576460752303423488; +const int MPG_FLAGS_INVALID_RIGHT_TRANSLATE_PORT = 7; -const int MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA = 1152921504606846976; +const int MPG_FLAGS_INVALID_RIGHT_TRANSLATE_PSET = 8; -const int MPG_FLAGS_STRICT_REPLY_MASK = -72057594037927936; +const int MPG_FLAGS_INVALID_VALUE_PEEK = 1; -const int MPG_FLAGS_MOD_REFS_PINNED_DEALLOC = 72057594037927936; +const int MPG_FLAGS_INVALID_VALUE_DELTA = 2; -const int MPG_FLAGS_MOD_REFS_PINNED_DESTROY = 144115188075855872; +const int MPG_FLAGS_INVALID_VALUE_DESTRUCT = 3; -const int MPG_FLAGS_MOD_REFS_PINNED_COPYIN = 288230376151711744; +const int MPG_FLAGS_KERN_FAILURE_TASK = 1; -const int MPG_FLAGS_IMMOVABLE_PINNED = 72057594037927936; +const int MPG_FLAGS_KERN_FAILURE_NOTIFY_TYPE = 2; + +const int MPG_FLAGS_KERN_FAILURE_NOTIFY_RECV = 3; + +const int MPG_FLAGS_KERN_FAILURE_MULTI_NOTI = 4; + +const int MPG_FLAGS_SEND_INVALID_RIGHT_PORT = 1; + +const int MPG_FLAGS_SEND_INVALID_RIGHT_OOL_PORT = 2; + +const int MPG_FLAGS_SEND_INVALID_RIGHT_GUARDED = 3; + +const int MPG_FLAGS_INVALID_OPTIONS_OOL_DISP = 1; + +const int MPG_FLAGS_INVALID_OPTIONS_OOL_ARRAYS = 2; + +const int MPG_FLAGS_INVALID_OPTIONS_OOL_RIGHT = 3; const int MPG_STRICT = 1; @@ -103981,6 +104556,8 @@ const int O_EXCL = 2048; const int O_RESOLVE_BENEATH = 4096; +const int O_UNIQUE = 8192; + const int O_EVTONLY = 32768; const int O_NOCTTY = 131072; @@ -104015,6 +104592,10 @@ const int AT_FDONLY = 1024; const int AT_SYMLINK_NOFOLLOW_ANY = 2048; +const int AT_RESOLVE_BENEATH = 8192; + +const int AT_NODELETEBUSY = 16384; + const int O_DP_GETRAWENCRYPTED = 1; const int O_DP_GETRAWUNENCRYPTED = 2; @@ -104163,6 +104744,8 @@ const int F_TRANSFEREXTENTS = 110; const int F_ATTRIBUTION_TAG = 111; +const int F_NOCACHE_EXT = 112; + const int F_ADDSIGS_MAIN_BINARY = 113; const int FCNTL_FS_SPECIFIC_BASE = 65536; diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 5179624b96..9b72b67a5a 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -16,12 +16,12 @@ dependencies: sdk: flutter http: ^1.5.0 http_profile: ^0.1.0 - objective_c: ^8.1.0 + objective_c: ^9.0.0 web_socket: '>=0.1.5 <2.0.0' dev_dependencies: dart_flutter_team_lints: ^3.0.0 - ffigen: ^19.1.0 + ffigen: ^20.0.0 flutter: plugin: From 53dd490e38496ec3b716f89a3e22da6d70cff4ed Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 12 Nov 2025 11:14:46 -0800 Subject: [PATCH 2/4] Update pubspec.yaml --- pkgs/cupertino_http/example/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index c54e37422e..2daf08691c 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -23,7 +23,7 @@ dev_dependencies: convert: ^3.1.1 crypto: ^3.0.3 dart_flutter_team_lints: ^3.0.0 - ffi: ^2.0.1 + ffi: ^2.1.4 flutter_test: sdk: flutter http_client_conformance_tests: @@ -31,7 +31,7 @@ dev_dependencies: http_profile: ^0.1.0 integration_test: sdk: flutter - objective_c: ^8.1.0 + objective_c: ^9.0.0 test: ^1.21.1 web_socket: '^1.0.0' web_socket_conformance_tests: From f958ac140af056412d09445825d75c64cdda6fd7 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 19 Nov 2025 08:00:09 -0800 Subject: [PATCH 3/4] Upgrade to .1's --- pkgs/cupertino_http/CHANGELOG.md | 2 +- .../native_cupertino_bindings.m | 2 +- pkgs/cupertino_http/example/pubspec.yaml | 2 +- .../cupertino_http/lib/src/cupertino_api.dart | 16 +- .../lib/src/native_cupertino_bindings.dart | 488 ++---------------- pkgs/cupertino_http/pubspec.yaml | 4 +- 6 files changed, 52 insertions(+), 462 deletions(-) diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index c0ece78d55..e0372d58ed 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.4.0-wip -* Switch to `package:objective_c` `8.1.0` and `package:ffigen` `19.1.0`. +* Switch to `package:objective_c` `9.1.0` and `package:ffigen` `20.1.0`. * Add URL to thrown `RequestAbortedException`. ## 2.3.0 diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m index 8c711fd3fb..d255bc826c 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -59,7 +59,7 @@ }; -typedef void (^_ListenerTrampoline)(); +typedef void (^_ListenerTrampoline)(void); __attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(_ListenerTrampoline block) NS_RETURNS_RETAINED { return ^void() { diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index 2daf08691c..165b61aeeb 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -31,7 +31,7 @@ dev_dependencies: http_profile: ^0.1.0 integration_test: sdk: flutter - objective_c: ^9.0.0 + objective_c: ^9.1.0 test: ^1.21.1 web_socket: '^1.0.0' web_socket_conformance_tests: diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index 67b9c0ffd2..2cf8b82f5d 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -870,7 +870,7 @@ class URLSession extends _ObjectHolder { final protoBuilder = objc.ObjCProtocolBuilder(); if (onComplete != null) { - ncb.NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + ncb.NSURLSessionDataDelegate$Builder.URLSession_task_didCompleteWithError_ .implementAsListener(protoBuilder, (nsSession, nsTask, nsError) { onComplete( URLSession._(nsSession, isBackground: isBackground), @@ -882,7 +882,7 @@ class URLSession extends _ObjectHolder { if (onRedirect != null) { ncb - .NSURLSessionDataDelegate + .NSURLSessionDataDelegate$Builder // ignore: lines_longer_than_80_chars .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implementAsListener( @@ -907,7 +907,7 @@ class URLSession extends _ObjectHolder { if (onResponse != null) { ncb - .NSURLSessionDataDelegate + .NSURLSessionDataDelegate$Builder .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsListener(protoBuilder, ( nsSession, @@ -926,7 +926,7 @@ class URLSession extends _ObjectHolder { } if (onData != null) { - ncb.NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + ncb.NSURLSessionDataDelegate$Builder.URLSession_dataTask_didReceiveData_ .implementAsListener(protoBuilder, (nsSession, nsDataTask, nsData) { onData( URLSession._(nsSession, isBackground: isBackground), @@ -938,7 +938,7 @@ class URLSession extends _ObjectHolder { if (onFinishedDownloading != null) { ncb - .NSURLSessionDownloadDelegate + .NSURLSessionDownloadDelegate$Builder .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsBlocking(protoBuilder, (nsSession, nsTask, nsUrl) { onFinishedDownloading( @@ -951,7 +951,7 @@ class URLSession extends _ObjectHolder { if (onWebSocketTaskOpened != null) { ncb - .NSURLSessionWebSocketDelegate + .NSURLSessionWebSocketDelegate$Builder .URLSession_webSocketTask_didOpenWithProtocol_ .implementAsListener(protoBuilder, (nsSession, nsTask, nsProtocol) { onWebSocketTaskOpened( @@ -964,7 +964,7 @@ class URLSession extends _ObjectHolder { if (onWebSocketTaskClosed != null) { ncb - .NSURLSessionWebSocketDelegate + .NSURLSessionWebSocketDelegate$Builder .URLSession_webSocketTask_didCloseWithCode_reason_ .implementAsListener(protoBuilder, ( nsSession, @@ -981,7 +981,7 @@ class URLSession extends _ObjectHolder { }); } - return ncb.NSURLSessionDelegate.castFrom(protoBuilder.build()); + return ncb.NSURLSessionDelegate.as(protoBuilder.build()); } URLSession._(super.c, {required bool isBackground}) diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index 3fc0c43600..f36f3c06fa 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -13510,7 +13510,7 @@ class NativeCupertinoHttp { CFStringRef theString, int encoding, ) { - return _CFStringGetPascalStringPtr(theString, encoding); + return _CFStringGetPascalStringPtr$1(theString, encoding); } late final _CFStringGetPascalStringPtrPtr = @@ -13519,7 +13519,7 @@ class NativeCupertinoHttp { ConstStringPtr Function(CFStringRef, CFStringEncoding) > >('CFStringGetPascalStringPtr'); - late final _CFStringGetPascalStringPtr = + late final _CFStringGetPascalStringPtr$1 = _CFStringGetPascalStringPtrPtr.asFunction< ConstStringPtr Function(CFStringRef, int) >(); @@ -13528,7 +13528,7 @@ class NativeCupertinoHttp { CFStringRef theString, int encoding, ) { - return _CFStringGetCStringPtr(theString, encoding); + return _CFStringGetCStringPtr$1(theString, encoding); } late final _CFStringGetCStringPtrPtr = @@ -13537,20 +13537,20 @@ class NativeCupertinoHttp { ffi.Pointer Function(CFStringRef, CFStringEncoding) > >('CFStringGetCStringPtr'); - late final _CFStringGetCStringPtr = + late final _CFStringGetCStringPtr$1 = _CFStringGetCStringPtrPtr.asFunction< ffi.Pointer Function(CFStringRef, int) >(); ffi.Pointer CFStringGetCharactersPtr(CFStringRef theString) { - return _CFStringGetCharactersPtr(theString); + return _CFStringGetCharactersPtr$1(theString); } late final _CFStringGetCharactersPtrPtr = _lookup Function(CFStringRef)>>( 'CFStringGetCharactersPtr', ); - late final _CFStringGetCharactersPtr = + late final _CFStringGetCharactersPtr$1 = _CFStringGetCharactersPtrPtr.asFunction< ffi.Pointer Function(CFStringRef) >(); @@ -92114,7 +92114,7 @@ extension NSArrayDiffing on objc.NSArray { /// differenceFromArray:withOptions: objc.NSOrderedCollectionDifference differenceFromArray$1( objc.NSArray other, { - required objc.NSOrderedCollectionDifferenceCalculationOptions withOptions, + required DartNSUInteger withOptions, }) { objc.checkOsVersionInternal( 'NSArray.differenceFromArray:withOptions:', @@ -92137,7 +92137,7 @@ extension NSArrayDiffing on objc.NSArray { /// differenceFromArray:withOptions:usingEquivalenceTest: objc.NSOrderedCollectionDifference differenceFromArray$2( objc.NSArray other, { - required objc.NSOrderedCollectionDifferenceCalculationOptions withOptions, + required DartNSUInteger withOptions, required objc.ObjCBlock< ffi.Bool Function( ffi.Pointer, @@ -93218,7 +93218,7 @@ late final _sel_loadPreviewImageWithOptions_completionHandler_ = objc .registerName("loadPreviewImageWithOptions:completionHandler:"); /// NSPreviewSupport -extension NSPreviewSupport on objc.NSItemProvider$2 { +extension NSPreviewSupport on objc.NSItemProvider { /// loadPreviewImageWithOptions:completionHandler: void loadPreviewImageWithOptions( objc.NSDictionary options, { @@ -94795,7 +94795,7 @@ extension NSMutableStringExtensionMethods on objc.NSMutableString { DartNSUInteger replaceOccurrencesOfString( objc.NSString target, { required objc.NSString withString, - required objc.NSStringCompareOptions options, + required DartNSUInteger options, required NSRange range, }) { return _objc_msgSend_1upeo1d( @@ -96748,7 +96748,7 @@ extension NSExceptionRaisingConveniences on NSException { typedef NSUncaughtExceptionHandler = ffi.NativeFunction< - ffi.Void Function(ffi.Pointer exception) + ffi.Void Function(ffi.Pointer exception$1) >; enum NSOperationQueuePriority { @@ -96878,113 +96878,41 @@ extension NSErrorRecoveryAttempting on objc.NSObject { } } -const int noErr$1 = 0; +const int noErr = 0; -const int kNilOptions$9 = 0; +const int kNilOptions = 0; const int kVariableLengthArray = 1; -const int kUnknownType$6 = 1061109567; - -const int normal$3 = 0; - -const int bold$7 = 1; - -const int italic$7 = 2; - -const int underline$5 = 4; - -const int outline$4 = 8; - -const int shadow$1 = 16; - -const int condense$2 = 32; - -const int extend$7 = 64; - -const int developStage$9 = 32; - -const int alphaStage$3 = 64; - -const int betaStage$9 = 96; - -const int finalStage$8 = 128; - -const int NSScannedOption$2 = 1; - -const int NSCollectorDisabledOption = 2; - -const int noErr$10 = 0; - -const int kNilOptions$7 = 0; - -const int kVariableLengthArray$9 = 1; - -const int kUnknownType$1 = 1061109567; - -const int normal$4 = 0; - -const int bold$8 = 1; - -const int italic$8 = 2; - -const int underline$10 = 4; - -const int outline$6 = 8; - -const int shadow = 16; - -const int condense$4 = 32; - -const int extend$8 = 64; - -const int developStage$7 = 32; - -const int alphaStage$2 = 64; - -const int betaStage$4 = 96; - -const int finalStage$5 = 128; - -const int NSScannedOption$9 = 1; - -const int NSCollectorDisabledOption$1 = 2; - -const int noErr$5 = 0; - -const int kNilOptions$1 = 0; - -const int kVariableLengthArray$5 = 1; - -const int kUnknownType$4 = 1061109567; +const int kUnknownType = 1061109567; -const int normal$9 = 0; +const int normal = 0; -const int bold$1 = 1; +const int bold = 1; -const int italic$6 = 2; +const int italic = 2; -const int underline$2 = 4; +const int underline = 4; const int outline = 8; -const int shadow$9 = 16; +const int shadow = 16; -const int condense$7 = 32; +const int condense = 32; -const int extend$1 = 64; +const int extend = 64; -const int developStage$8 = 32; +const int developStage = 32; -const int alphaStage$9 = 64; +const int alphaStage = 64; -const int betaStage$8 = 96; +const int betaStage = 96; -const int finalStage$2 = 128; +const int finalStage = 128; -const int NSScannedOption$7 = 1; +const int NSScannedOption = 1; -const int NSCollectorDisabledOption$2 = 2; +const int NSCollectorDisabledOption = 2; const int errSecSuccess = 0; @@ -101610,45 +101538,9 @@ const int SSL_RSA_WITH_3DES_EDE_CBC_MD5 = -125; const int SSL_NO_SUCH_CIPHERSUITE = -1; -const int noErr = 0; - -const int kNilOptions$4 = 0; - -const int kVariableLengthArray$1 = 1; - -const int kUnknownType$9 = 1061109567; - -const int normal = 0; - -const int bold$5 = 1; - -const int italic$5 = 2; - -const int underline$6 = 4; - -const int outline$9 = 8; - -const int shadow$8 = 16; - -const int condense = 32; - -const int extend$4 = 64; - -const int developStage$2 = 32; - -const int alphaStage$6 = 64; - -const int betaStage$3 = 96; - -const int finalStage$10 = 128; - -const int NSScannedOption$10 = 1; - -const int NSCollectorDisabledOption$10 = 2; - -const int NSASCIIStringEncoding$1 = 1; +const int NSASCIIStringEncoding = 1; -const int NSNEXTSTEPStringEncoding$1 = 2; +const int NSNEXTSTEPStringEncoding = 2; const int NSJapaneseEUCStringEncoding = 3; @@ -101656,243 +101548,13 @@ const int NSUTF8StringEncoding = 4; const int NSISOLatin1StringEncoding = 5; -const int NSSymbolStringEncoding$1 = 6; - -const int NSNonLossyASCIIStringEncoding = 7; - -const int NSShiftJISStringEncoding$1 = 8; - -const int NSISOLatin2StringEncoding = 9; - -const int NSUnicodeStringEncoding$1 = 10; - -const int NSWindowsCP1251StringEncoding$1 = 11; - -const int NSWindowsCP1252StringEncoding$1 = 12; - -const int NSWindowsCP1253StringEncoding$1 = 13; - -const int NSWindowsCP1254StringEncoding$1 = 14; - -const int NSWindowsCP1250StringEncoding$1 = 15; - -const int NSISO2022JPStringEncoding = 21; - -const int NSMacOSRomanStringEncoding = 30; - -const int NSUTF16StringEncoding$1 = 10; - -const int NSUTF16BigEndianStringEncoding = 2415919360; - -const int NSUTF16LittleEndianStringEncoding$1 = 2483028224; - -const int NSUTF32StringEncoding = 2348810496; - -const int NSUTF32BigEndianStringEncoding = 2550137088; - -const int NSUTF32LittleEndianStringEncoding = 2617245952; - -const int NSProprietaryStringEncoding = 65536; - -const int NSOpenStepUnicodeReservedBase = 62464; - -const int noErr$3 = 0; - -const int kNilOptions$5 = 0; - -const int kVariableLengthArray$7 = 1; - -const int kUnknownType$10 = 1061109567; - -const int normal$2 = 0; - -const int bold = 1; - -const int italic$3 = 2; - -const int underline$9 = 4; - -const int outline$7 = 8; - -const int shadow$7 = 16; - -const int condense$3 = 32; - -const int extend$2 = 64; - -const int developStage$4 = 32; - -const int alphaStage$7 = 64; - -const int betaStage = 96; - -const int finalStage$9 = 128; - -const int NSScannedOption$1 = 1; - -const int NSCollectorDisabledOption$3 = 2; - -const int noErr$4 = 0; - -const int kNilOptions$8 = 0; - -const int kVariableLengthArray$3 = 1; - -const int kUnknownType$8 = 1061109567; - -const int normal$6 = 0; - -const int bold$10 = 1; - -const int italic$1 = 2; - -const int underline$7 = 4; - -const int outline$3 = 8; - -const int shadow$5 = 16; - -const int condense$9 = 32; - -const int extend = 64; - -const int developStage$5 = 32; - -const int alphaStage$8 = 64; - -const int betaStage$1 = 96; - -const int finalStage$1 = 128; - -const int NSScannedOption$6 = 1; - -const int NSCollectorDisabledOption$4 = 2; - -const int noErr$7 = 0; - -const int kNilOptions$10 = 0; - -const int kVariableLengthArray$10 = 1; - -const int kUnknownType$7 = 1061109567; - -const int normal$8 = 0; - -const int bold$3 = 1; - -const int italic$2 = 2; - -const int underline$4 = 4; - -const int outline$1 = 8; - -const int shadow$6 = 16; - -const int condense$6 = 32; - -const int extend$3 = 64; - -const int developStage$10 = 32; - -const int alphaStage$1 = 64; - -const int betaStage$6 = 96; - -const int finalStage$7 = 128; - -const int NSScannedOption = 1; - -const int NSCollectorDisabledOption$5 = 2; - -const int noErr$8 = 0; - -const int kNilOptions$3 = 0; - -const int kVariableLengthArray$4 = 1; - -const int kUnknownType$5 = 1061109567; - -const int normal$7 = 0; - -const int bold$6 = 1; - -const int italic$10 = 2; - -const int underline$1 = 4; - -const int outline$5 = 8; - -const int shadow$3 = 16; - -const int condense$1 = 32; - -const int extend$6 = 64; - -const int developStage$1 = 32; - -const int alphaStage$4 = 64; - -const int betaStage$2 = 96; - -const int finalStage = 128; - -const int NSScannedOption$8 = 1; - -const int NSCollectorDisabledOption$6 = 2; - -const int noErr$2 = 0; - -const int kNilOptions$2 = 0; - -const int kVariableLengthArray$8 = 1; - -const int kUnknownType$2 = 1061109567; - -const int normal$1 = 0; - -const int bold$4 = 1; - -const int italic$9 = 2; - -const int underline = 4; - -const int outline$10 = 8; - -const int shadow$4 = 16; - -const int condense$5 = 32; - -const int extend$9 = 64; - -const int developStage = 32; - -const int alphaStage = 64; - -const int betaStage$10 = 96; - -const int finalStage$4 = 128; - -const int NSScannedOption$4 = 1; - -const int NSCollectorDisabledOption$7 = 2; - -const int NSASCIIStringEncoding = 1; - -const int NSNEXTSTEPStringEncoding = 2; - -const int NSJapaneseEUCStringEncoding$1 = 3; - -const int NSUTF8StringEncoding$1 = 4; - -const int NSISOLatin1StringEncoding$1 = 5; - const int NSSymbolStringEncoding = 6; -const int NSNonLossyASCIIStringEncoding$1 = 7; +const int NSNonLossyASCIIStringEncoding = 7; const int NSShiftJISStringEncoding = 8; -const int NSISOLatin2StringEncoding$1 = 9; +const int NSISOLatin2StringEncoding = 9; const int NSUnicodeStringEncoding = 10; @@ -101906,97 +101568,25 @@ const int NSWindowsCP1254StringEncoding = 14; const int NSWindowsCP1250StringEncoding = 15; -const int NSISO2022JPStringEncoding$1 = 21; +const int NSISO2022JPStringEncoding = 21; -const int NSMacOSRomanStringEncoding$1 = 30; +const int NSMacOSRomanStringEncoding = 30; const int NSUTF16StringEncoding = 10; -const int NSUTF16BigEndianStringEncoding$1 = 2415919360; +const int NSUTF16BigEndianStringEncoding = 2415919360; const int NSUTF16LittleEndianStringEncoding = 2483028224; -const int NSUTF32StringEncoding$1 = 2348810496; - -const int NSUTF32BigEndianStringEncoding$1 = 2550137088; - -const int NSUTF32LittleEndianStringEncoding$1 = 2617245952; - -const int NSProprietaryStringEncoding$1 = 65536; - -const int DISPATCH_WALLTIME_NOW$1 = -2; - -const int noErr$9 = 0; - -const int kNilOptions$6 = 0; - -const int kVariableLengthArray$6 = 1; - -const int kUnknownType = 1061109567; - -const int normal$10 = 0; - -const int bold$9 = 1; - -const int italic = 2; - -const int underline$3 = 4; - -const int outline$2 = 8; - -const int shadow$10 = 16; - -const int condense$10 = 32; - -const int extend$10 = 64; - -const int developStage$3 = 32; - -const int alphaStage$10 = 64; - -const int betaStage$5 = 96; - -const int finalStage$3 = 128; - -const int NSScannedOption$5 = 1; - -const int NSCollectorDisabledOption$8 = 2; - -const int noErr$6 = 0; - -const int kNilOptions = 0; - -const int kVariableLengthArray$2 = 1; - -const int kUnknownType$3 = 1061109567; - -const int normal$5 = 0; - -const int bold$2 = 1; - -const int italic$4 = 2; - -const int underline$8 = 4; - -const int outline$8 = 8; - -const int shadow$2 = 16; - -const int condense$8 = 32; - -const int extend$5 = 64; - -const int developStage$6 = 32; - -const int alphaStage$5 = 64; +const int NSUTF32StringEncoding = 2348810496; -const int betaStage$7 = 96; +const int NSUTF32BigEndianStringEncoding = 2550137088; -const int finalStage$6 = 128; +const int NSUTF32LittleEndianStringEncoding = 2617245952; -const int NSScannedOption$3 = 1; +const int NSProprietaryStringEncoding = 65536; -const int NSCollectorDisabledOption$9 = 2; +const int NSOpenStepUnicodeReservedBase = 62464; const int __API_TO_BE_DEPRECATED = 100000; diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 9b72b67a5a..6ffb22407b 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -16,12 +16,12 @@ dependencies: sdk: flutter http: ^1.5.0 http_profile: ^0.1.0 - objective_c: ^9.0.0 + objective_c: ^9.1.0 web_socket: '>=0.1.5 <2.0.0' dev_dependencies: dart_flutter_team_lints: ^3.0.0 - ffigen: ^20.0.0 + ffigen: ^20.1.0 flutter: plugin: From 8666003858c669466d5c2e080c8f76c08e7aeafd Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 19 Nov 2025 09:40:20 -0800 Subject: [PATCH 4/4] Remove -wip --- pkgs/cupertino_http/CHANGELOG.md | 2 +- pkgs/cupertino_http/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index e0372d58ed..8a1e5cc821 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.4.0-wip +## 2.4.0 * Switch to `package:objective_c` `9.1.0` and `package:ffigen` `20.1.0`. * Add URL to thrown `RequestAbortedException`. diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 6ffb22407b..816c5b5bab 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cupertino_http -version: 2.4.0-wip +version: 2.4.0 description: >- A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System.