blob: 7a98f948838fddbeda64c4018b82f1a25e10cb3e [file]
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint, unused_import
@ffi.DefaultAsset('package:ffigen/objc_test')
library;
import 'dart:ffi' as ffi;
import 'package:objective_c/objective_c.dart' as objc;
import 'package:ffi/ffi.dart' as pkg_ffi;
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_1bqef4y(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_1d9e4oe(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_1pl9qdv(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_f167m6(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_li50va(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_ru30ue(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_xtuoz7(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.DOBJC_Context>,
)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapBlockingBlock_yhkuco(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCBlockImpl> listnerBlock,
ffi.Pointer<objc.DOBJC_Context> context,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_1bqef4y(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_1d9e4oe(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_1pl9qdv(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_f167m6(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_li50va(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_ru30ue(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_xtuoz7(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<
ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _18tji2r_wrapListenerBlock_yhkuco(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>()
external void objc_autoreleasePoolPop(ffi.Pointer<ffi.Void> pool);
@ffi.Native<ffi.Pointer<ffi.Void> Function()>()
external ffi.Pointer<ffi.Void> objc_autoreleasePoolPush();
typedef BlockBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartBlockBlock =
objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>;
/// BlockTester
extension type BlockTester._(objc.ObjCObject object$)
implements objc.ObjCObject, objc.NSObject {
/// Constructs a [BlockTester] that points to the same underlying object as [other].
BlockTester.as(objc.ObjCObject other) : object$ = other {
assert(isA(object$));
}
/// Constructs a [BlockTester] that wraps the given raw object pointer.
BlockTester.fromPointer(
ffi.Pointer<objc.ObjCObjectImpl> 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 [BlockTester].
static bool isA(objc.ObjCObject? obj) => obj == null
? false
: _objc_msgSend_19nvye5(
obj.ref.pointer,
_sel_isKindOfClass_,
_class_BlockTester,
);
/// alloc
static BlockTester alloc() {
final $ret = _objc_msgSend_151sglz(_class_BlockTester, _sel_alloc);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// allocWithZone:
static BlockTester allocWithZone(ffi.Pointer<objc.NSZone> zone) {
final $ret = _objc_msgSend_1cwp428(
_class_BlockTester,
_sel_allocWithZone_,
zone,
);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// blockingBlockTest:resultBlock:
static void blockingBlockTest(
objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)> blockingBlock, {
required objc.ObjCBlock<ffi.Void Function(ffi.Int32)> resultBlock,
}) {
_objc_msgSend_18yul99(
_class_BlockTester,
_sel_blockingBlockTest_resultBlock_,
blockingBlock.ref.pointer,
resultBlock.ref.pointer,
);
}
/// callDoubleBlock:
static double callDoubleBlock(DartDoubleBlock block) {
return objc.useMsgSendVariants
? _objc_msgSend_8mj2fvFpret(
_class_BlockTester,
_sel_callDoubleBlock_,
block.ref.pointer,
)
: _objc_msgSend_8mj2fv(
_class_BlockTester,
_sel_callDoubleBlock_,
block.ref.pointer,
);
}
/// callFloatBlock:
static double callFloatBlock(DartFloatBlock block) {
return objc.useMsgSendVariants
? _objc_msgSend_o8bnmsFpret(
_class_BlockTester,
_sel_callFloatBlock_,
block.ref.pointer,
)
: _objc_msgSend_o8bnms(
_class_BlockTester,
_sel_callFloatBlock_,
block.ref.pointer,
);
}
/// callListener:
static void callListener(DartListenerBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callListener_,
block.ref.pointer,
);
}
/// callNSStringListener:x:
static void callNSStringListener(
DartNSStringListenerBlock block, {
required int x,
}) {
_objc_msgSend_po4t03(
_class_BlockTester,
_sel_callNSStringListener_x_,
block.ref.pointer,
x,
);
}
/// callNoTrampolineListener:
static void callNoTrampolineListener(DartNoTrampolineListenerBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callNoTrampolineListener_,
block.ref.pointer,
);
}
/// callNullableListener:
static void callNullableListener(DartNullableListenerBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callNullableListener_,
block.ref.pointer,
);
}
/// callNullableObjectBlock:
static DummyObject? callNullableObjectBlock(DartNullableObjectBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_callNullableObjectBlock_,
block.ref.pointer,
);
return $ret.address == 0
? null
: DummyObject.fromPointer($ret, retain: false, release: true);
}
/// callNullableStringBlock:
static objc.NSString? callNullableStringBlock(
objc.ObjCBlock<objc.NSString? Function(objc.NSString?)> block,
) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_callNullableStringBlock_,
block.ref.pointer,
);
return $ret.address == 0
? null
: objc.NSString.fromPointer($ret, retain: false, release: true);
}
/// callObjectBlock:
static DummyObject callObjectBlock(DartObjectBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_callObjectBlock_,
block.ref.pointer,
);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// callObjectListener:
static void callObjectListener(DartObjectListenerBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callObjectListener_,
block.ref.pointer,
);
}
/// callOnNewThread:
static NSThread callOnNewThread(DartVoidBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_callOnNewThread_,
block.ref.pointer,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// callOnSameThread:
static void callOnSameThread(DartVoidBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callOnSameThread_,
block.ref.pointer,
);
}
/// callOnSameThreadOutsideIsolate:
static void callOnSameThreadOutsideIsolate(DartVoidBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callOnSameThreadOutsideIsolate_,
block.ref.pointer,
);
}
/// callSelectorBlock:
static void callSelectorBlock(DartSelectorBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callSelectorBlock_,
block.ref.pointer,
);
}
/// callStructListener:
static void callStructListener(DartStructListenerBlock block) {
_objc_msgSend_f167m6(
_class_BlockTester,
_sel_callStructListener_,
block.ref.pointer,
);
}
/// callVec4Block:
static Vec4 callVec4Block(DartVec4Block block) {
final $ptr = pkg_ffi.calloc<Vec4>();
objc.useMsgSendVariants
? _objc_msgSend_1gew1vmStret(
$ptr,
_class_BlockTester,
_sel_callVec4Block_,
block.ref.pointer,
)
: $ptr.ref = _objc_msgSend_1gew1vm(
_class_BlockTester,
_sel_callVec4Block_,
block.ref.pointer,
);
final $finalizable = $ptr.cast<ffi.Uint8>().asTypedList(
ffi.sizeOf<Vec4>(),
finalizer: pkg_ffi.calloc.nativeFree,
);
return ffi.Struct.create<Vec4>($finalizable);
}
/// callWithBlockOnNewThread:
static NSThread callWithBlockOnNewThread(DartListenerBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_callWithBlockOnNewThread_,
block.ref.pointer,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// new
static BlockTester new$() {
final $ret = _objc_msgSend_151sglz(_class_BlockTester, _sel_new);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// newBlock:withMult:
static DartIntBlock newBlock(DartBlockBlock block, {required int withMult}) {
final $ret = _objc_msgSend_jevgay(
_class_BlockTester,
_sel_newBlock_withMult_,
block.ref.pointer,
withMult,
);
return ObjCBlock_Int32_Int32.fromPointer(
$ret,
retain: false,
release: true,
);
}
/// newBlockBlock:
static DartBlockBlock newBlockBlock(int mult) {
final $ret = _objc_msgSend_w43bzz(
_class_BlockTester,
_sel_newBlockBlock_,
mult,
);
return ObjCBlock_IntBlock_IntBlock.fromPointer(
$ret,
retain: false,
release: true,
);
}
/// newFromBlock:
static BlockTester newFromBlock(DartIntBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_newFromBlock_,
block.ref.pointer,
);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// newFromListener:
static BlockTester newFromListener(DartObjectListenerBlock block) {
final $ret = _objc_msgSend_nnxkei(
_class_BlockTester,
_sel_newFromListener_,
block.ref.pointer,
);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// newFromMultiplier:
static BlockTester newFromMultiplier(int mult) {
final $ret = _objc_msgSend_aclumu(
_class_BlockTester,
_sel_newFromMultiplier_,
mult,
);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// setup:
static void setup(ffi.Pointer<ffi.Void> apiData) {
_objc_msgSend_ovsamd(_class_BlockTester, _sel_setup_, apiData);
}
/// Returns a new instance of BlockTester constructed with the default `new` method.
BlockTester() : this.as(new$().object$);
}
extension BlockTester$Methods on BlockTester {
/// call:
int call(int x) {
return _objc_msgSend_zo3bvx(object$.ref.pointer, _sel_call_, x);
}
/// getBlock
DartIntBlock getBlock() {
final $ret = _objc_msgSend_uwvaik(object$.ref.pointer, _sel_getBlock);
return ObjCBlock_Int32_Int32.fromPointer(
$ret,
retain: false,
release: true,
);
}
/// init
BlockTester init() {
objc.checkOsVersionInternal(
'BlockTester.init',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 0, 0)),
);
final $ret = _objc_msgSend_151sglz(
object$.ref.retainAndReturnPointer(),
_sel_init,
);
return BlockTester.fromPointer($ret, retain: false, release: true);
}
/// invokeAndReleaseListener:
void invokeAndReleaseListener(objc.ObjCObject? _$) {
_objc_msgSend_xtuoz7(
object$.ref.pointer,
_sel_invokeAndReleaseListener_,
_$?.ref.pointer ?? ffi.nullptr,
);
}
/// invokeAndReleaseListenerOnNewThread
void invokeAndReleaseListenerOnNewThread() {
_objc_msgSend_1pl9qdv(
object$.ref.pointer,
_sel_invokeAndReleaseListenerOnNewThread,
);
}
/// pokeBlock
void pokeBlock() {
_objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_pokeBlock);
}
}
typedef DoubleBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartDoubleBlock = objc.ObjCBlock<ffi.Double Function(ffi.Double)>;
/// DummyObject
extension type DummyObject._(objc.ObjCObject object$)
implements objc.ObjCObject, objc.NSObject {
/// Constructs a [DummyObject] that points to the same underlying object as [other].
DummyObject.as(objc.ObjCObject other) : object$ = other {
assert(isA(object$));
}
/// Constructs a [DummyObject] that wraps the given raw object pointer.
DummyObject.fromPointer(
ffi.Pointer<objc.ObjCObjectImpl> 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 [DummyObject].
static bool isA(objc.ObjCObject? obj) => obj == null
? false
: _objc_msgSend_19nvye5(
obj.ref.pointer,
_sel_isKindOfClass_,
_class_DummyObject,
);
/// alloc
static DummyObject alloc() {
final $ret = _objc_msgSend_151sglz(_class_DummyObject, _sel_alloc);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// allocWithZone:
static DummyObject allocWithZone(ffi.Pointer<objc.NSZone> zone) {
final $ret = _objc_msgSend_1cwp428(
_class_DummyObject,
_sel_allocWithZone_,
zone,
);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// new
static DummyObject new$() {
final $ret = _objc_msgSend_151sglz(_class_DummyObject, _sel_new);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// newWithCounter:
static DummyObject newWithCounter(ffi.Pointer<ffi.Int32> _counter) {
final $ret = _objc_msgSend_129vhbw(
_class_DummyObject,
_sel_newWithCounter_,
_counter,
);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// Returns a new instance of DummyObject constructed with the default `new` method.
DummyObject() : this.as(new$().object$);
}
extension DummyObject$Methods on DummyObject {
/// dealloc
void dealloc() {
_objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_dealloc);
}
/// init
DummyObject init() {
objc.checkOsVersionInternal(
'DummyObject.init',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 0, 0)),
);
final $ret = _objc_msgSend_151sglz(
object$.ref.retainAndReturnPointer(),
_sel_init,
);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// initWithCounter:
DummyObject initWithCounter(ffi.Pointer<ffi.Int32> _counter) {
final $ret = _objc_msgSend_129vhbw(
object$.ref.retainAndReturnPointer(),
_sel_initWithCounter_,
_counter,
);
return DummyObject.fromPointer($ret, retain: false, release: true);
}
/// setCounter:
void setCounter(ffi.Pointer<ffi.Int32> _counter) {
_objc_msgSend_yhkuco(object$.ref.pointer, _sel_setCounter_, _counter);
}
}
typedef FloatBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartFloatBlock = objc.ObjCBlock<ffi.Float Function(ffi.Float)>;
typedef IntBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartIntBlock = objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>;
typedef ListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartListenerBlock =
objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>;
typedef NSStringListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartNSStringListenerBlock =
objc.ObjCBlock<ffi.Void Function(objc.NSString)>;
/// NSThread
extension type NSThread._(objc.ObjCObject object$)
implements objc.ObjCObject, objc.NSObject {
/// Constructs a [NSThread] that points to the same underlying object as [other].
NSThread.as(objc.ObjCObject other) : object$ = other {
assert(isA(object$));
}
/// Constructs a [NSThread] that wraps the given raw object pointer.
NSThread.fromPointer(
ffi.Pointer<objc.ObjCObjectImpl> 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 [NSThread].
static bool isA(objc.ObjCObject? obj) => obj == null
? false
: _objc_msgSend_19nvye5(
obj.ref.pointer,
_sel_isKindOfClass_,
_class_NSThread,
);
/// alloc
static NSThread alloc() {
final $ret = _objc_msgSend_151sglz(_class_NSThread, _sel_alloc);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// allocWithZone:
static NSThread allocWithZone(ffi.Pointer<objc.NSZone> zone) {
final $ret = _objc_msgSend_1cwp428(
_class_NSThread,
_sel_allocWithZone_,
zone,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// callStackReturnAddresses
static objc.NSArray getCallStackReturnAddresses() {
objc.checkOsVersionInternal(
'NSThread.callStackReturnAddresses',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
final $ret = _objc_msgSend_151sglz(
_class_NSThread,
_sel_callStackReturnAddresses,
);
return objc.NSArray.fromPointer($ret, retain: true, release: true);
}
/// callStackSymbols
static objc.NSArray getCallStackSymbols() {
objc.checkOsVersionInternal(
'NSThread.callStackSymbols',
iOS: (false, (4, 0, 0)),
macOS: (false, (10, 6, 0)),
);
final $ret = _objc_msgSend_151sglz(_class_NSThread, _sel_callStackSymbols);
return objc.NSArray.fromPointer($ret, retain: true, release: true);
}
/// currentThread
static NSThread getCurrentThread() {
final $ret = _objc_msgSend_151sglz(_class_NSThread, _sel_currentThread);
return NSThread.fromPointer($ret, retain: true, release: true);
}
/// detachNewThreadSelector:toTarget:withObject:
static void detachNewThreadSelector(
ffi.Pointer<objc.ObjCSelector> selector, {
required objc.ObjCObject toTarget,
objc.ObjCObject? withObject,
}) {
_objc_msgSend_lzbvjm(
_class_NSThread,
_sel_detachNewThreadSelector_toTarget_withObject_,
selector,
toTarget.ref.pointer,
withObject?.ref.pointer ?? ffi.nullptr,
);
}
/// detachNewThreadWithBlock:
static void detachNewThreadWithBlock(
objc.ObjCBlock<ffi.Void Function()> block,
) {
objc.checkOsVersionInternal(
'NSThread.detachNewThreadWithBlock:',
iOS: (false, (10, 0, 0)),
macOS: (false, (10, 12, 0)),
);
_objc_msgSend_f167m6(
_class_NSThread,
_sel_detachNewThreadWithBlock_,
block.ref.pointer,
);
}
/// exit
static void exit() {
_objc_msgSend_1pl9qdv(_class_NSThread, _sel_exit);
}
/// isMainThread
static bool getIsMainThread$1() {
objc.checkOsVersionInternal(
'NSThread.isMainThread',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_91o635(_class_NSThread, _sel_isMainThread);
}
/// isMultiThreaded
static bool isMultiThreaded() {
return _objc_msgSend_91o635(_class_NSThread, _sel_isMultiThreaded);
}
/// mainThread
static NSThread getMainThread() {
objc.checkOsVersionInternal(
'NSThread.mainThread',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
final $ret = _objc_msgSend_151sglz(_class_NSThread, _sel_mainThread);
return NSThread.fromPointer($ret, retain: true, release: true);
}
/// new
static NSThread new$() {
final $ret = _objc_msgSend_151sglz(_class_NSThread, _sel_new);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// setThreadPriority:
static bool setThreadPriority(double p) {
return _objc_msgSend_18chyc(_class_NSThread, _sel_setThreadPriority_, p);
}
/// sleepForTimeInterval:
static void sleepForTimeInterval(double ti) {
_objc_msgSend_hwm8nu(_class_NSThread, _sel_sleepForTimeInterval_, ti);
}
/// sleepUntilDate:
static void sleepUntilDate(objc.NSDate date) {
_objc_msgSend_xtuoz7(
_class_NSThread,
_sel_sleepUntilDate_,
date.ref.pointer,
);
}
/// threadPriority
static double threadPriority$1() {
return objc.useMsgSendVariants
? _objc_msgSend_1ukqyt8Fpret(_class_NSThread, _sel_threadPriority)
: _objc_msgSend_1ukqyt8(_class_NSThread, _sel_threadPriority);
}
/// Returns a new instance of NSThread constructed with the default `new` method.
NSThread() : this.as(new$().object$);
}
extension NSThread$Methods on NSThread {
/// cancel
void cancel() {
objc.checkOsVersionInternal(
'NSThread.cancel',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
_objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_cancel);
}
/// init
NSThread init() {
objc.checkOsVersionInternal(
'NSThread.init',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 0, 0)),
);
final $ret = _objc_msgSend_151sglz(
object$.ref.retainAndReturnPointer(),
_sel_init,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// initWithBlock:
NSThread initWithBlock(objc.ObjCBlock<ffi.Void Function()> block) {
objc.checkOsVersionInternal(
'NSThread.initWithBlock:',
iOS: (false, (10, 0, 0)),
macOS: (false, (10, 12, 0)),
);
final $ret = _objc_msgSend_nnxkei(
object$.ref.retainAndReturnPointer(),
_sel_initWithBlock_,
block.ref.pointer,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// initWithTarget:selector:object:
NSThread initWithTarget(
objc.ObjCObject target, {
required ffi.Pointer<objc.ObjCSelector> selector,
objc.ObjCObject? object,
}) {
objc.checkOsVersionInternal(
'NSThread.initWithTarget:selector:object:',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
final $ret = _objc_msgSend_1eldwyi(
object$.ref.retainAndReturnPointer(),
_sel_initWithTarget_selector_object_,
target.ref.pointer,
selector,
object?.ref.pointer ?? ffi.nullptr,
);
return NSThread.fromPointer($ret, retain: false, release: true);
}
/// isCancelled
bool get isCancelled {
objc.checkOsVersionInternal(
'NSThread.isCancelled',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_91o635(object$.ref.pointer, _sel_isCancelled);
}
/// isExecuting
bool get isExecuting {
objc.checkOsVersionInternal(
'NSThread.isExecuting',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_91o635(object$.ref.pointer, _sel_isExecuting);
}
/// isFinished
bool get isFinished {
objc.checkOsVersionInternal(
'NSThread.isFinished',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_91o635(object$.ref.pointer, _sel_isFinished);
}
/// isMainThread
bool get isMainThread {
objc.checkOsVersionInternal(
'NSThread.isMainThread',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_91o635(object$.ref.pointer, _sel_isMainThread);
}
/// main
void main() {
objc.checkOsVersionInternal(
'NSThread.main',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
_objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_main);
}
/// name
objc.NSString? get name {
objc.checkOsVersionInternal(
'NSThread.name',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_name);
return $ret.address == 0
? null
: objc.NSString.fromPointer($ret, retain: true, release: true);
}
/// qualityOfService
objc.NSQualityOfService get qualityOfService {
objc.checkOsVersionInternal(
'NSThread.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);
}
/// setName:
set name(objc.NSString? value) {
objc.checkOsVersionInternal(
'NSThread.setName:',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
_objc_msgSend_xtuoz7(
object$.ref.pointer,
_sel_setName_,
value?.ref.pointer ?? ffi.nullptr,
);
}
/// setQualityOfService:
set qualityOfService(objc.NSQualityOfService value) {
objc.checkOsVersionInternal(
'NSThread.setQualityOfService:',
iOS: (false, (8, 0, 0)),
macOS: (false, (10, 10, 0)),
);
_objc_msgSend_n2da1l(
object$.ref.pointer,
_sel_setQualityOfService_,
value.value,
);
}
/// setStackSize:
set stackSize(int value) {
objc.checkOsVersionInternal(
'NSThread.setStackSize:',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
_objc_msgSend_1i9r4xy(object$.ref.pointer, _sel_setStackSize_, value);
}
/// setThreadPriority:
set threadPriority(double value) {
objc.checkOsVersionInternal(
'NSThread.setThreadPriority:',
iOS: (false, (4, 0, 0)),
macOS: (false, (10, 6, 0)),
);
_objc_msgSend_hwm8nu(object$.ref.pointer, _sel_setThreadPriority_, value);
}
/// stackSize
int get stackSize {
objc.checkOsVersionInternal(
'NSThread.stackSize',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
return _objc_msgSend_xw2lbc(object$.ref.pointer, _sel_stackSize);
}
/// start
void start() {
objc.checkOsVersionInternal(
'NSThread.start',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 5, 0)),
);
_objc_msgSend_1pl9qdv(object$.ref.pointer, _sel_start);
}
/// threadDictionary
objc.NSMutableDictionary get threadDictionary {
final $ret = _objc_msgSend_151sglz(
object$.ref.pointer,
_sel_threadDictionary,
);
return objc.NSMutableDictionary.fromPointer(
$ret,
retain: true,
release: true,
);
}
/// threadPriority
double get threadPriority {
objc.checkOsVersionInternal(
'NSThread.threadPriority',
iOS: (false, (4, 0, 0)),
macOS: (false, (10, 6, 0)),
);
return objc.useMsgSendVariants
? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_threadPriority)
: _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_threadPriority);
}
}
typedef NoTrampolineListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartNoTrampolineListenerBlock =
objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>;
typedef NullableListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartNullableListenerBlock =
objc.ObjCBlock<ffi.Void Function(DummyObject?)>;
typedef NullableObjectBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartNullableObjectBlock =
objc.ObjCBlock<DummyObject? Function(DummyObject?)>;
/// Construction methods for `objc.ObjCBlock<DummyObject Function(DummyObject)>`.
abstract final class ObjCBlock_DummyObject_DummyObject {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<DummyObject Function(DummyObject)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<DummyObject Function(DummyObject)>(
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<DummyObject Function(DummyObject)> fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>
ptr,
) => objc.ObjCBlock<DummyObject Function(DummyObject)>(
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<DummyObject Function(DummyObject)> fromFunction(
DummyObject Function(DummyObject) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<DummyObject Function(DummyObject)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) => fn(
DummyObject.fromPointer(arg0, retain: true, release: true),
).ref.retainAndAutorelease(),
keepIsolateAlive,
),
retain: false,
release: true,
);
static ffi.Pointer<objc.ObjCObjectImpl> _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static ffi.Pointer<objc.ObjCObjectImpl> _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<DummyObject Function(DummyObject)>`.
extension ObjCBlock_DummyObject_DummyObject$CallExtension
on objc.ObjCBlock<DummyObject Function(DummyObject)> {
DummyObject call(DummyObject arg0) => DummyObject.fromPointer(
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0.ref.pointer),
retain: true,
release: true,
);
}
/// Construction methods for `objc.ObjCBlock<DummyObject? Function(DummyObject?)>`.
abstract final class ObjCBlock_DummyObject_DummyObject$1 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<DummyObject? Function(DummyObject?)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<DummyObject? Function(DummyObject?)>(
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<DummyObject? Function(DummyObject?)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>
ptr,
) => objc.ObjCBlock<DummyObject? Function(DummyObject?)>(
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<DummyObject? Function(DummyObject?)> fromFunction(
DummyObject? Function(DummyObject?) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<DummyObject? Function(DummyObject?)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(
arg0.address == 0
? null
: DummyObject.fromPointer(arg0, retain: true, release: true),
)?.ref.retainAndAutorelease() ??
ffi.nullptr,
keepIsolateAlive,
),
retain: false,
release: true,
);
static ffi.Pointer<objc.ObjCObjectImpl> _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static ffi.Pointer<objc.ObjCObjectImpl> _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<DummyObject? Function(DummyObject?)>`.
extension ObjCBlock_DummyObject_DummyObject$1$CallExtension
on objc.ObjCBlock<DummyObject? Function(DummyObject?)> {
DummyObject? call(DummyObject? arg0) =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr)
.address ==
0
? null
: DummyObject.fromPointer(
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr),
retain: true,
release: true,
);
}
/// Construction methods for `objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>`.
abstract final class ObjCBlock_Int32_Int32 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>(
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.Int32 Function(ffi.Int32)> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Int32 Function(ffi.Int32 arg0)>> ptr,
) => objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>(
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.Int32 Function(ffi.Int32)> fromFunction(
int Function(int) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>(
objc.newClosureBlock(
_closureCallable,
(int arg0) => fn(arg0),
keepIsolateAlive,
),
retain: false,
release: true,
);
static int _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
) => block.ref.target
.cast<ffi.NativeFunction<ffi.Int32 Function(ffi.Int32 arg0)>>()
.asFunction<int Function(int)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Int32 Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>(_fnPtrTrampoline, 0)
.cast();
static int _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
) => (objc.getBlockClosure(block) as int Function(int))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Int32 Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>(_closureTrampoline, 0)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>`.
extension ObjCBlock_Int32_Int32$CallExtension
on objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> {
int call(int arg0) =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Int32 Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Int32 arg0,
)
>
>()
.asFunction<int Function(ffi.Pointer<objc.ObjCBlockImpl>, int)>()(
ref.pointer,
arg0,
);
}
/// Construction methods for `objc.ObjCBlock<objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)>`.
abstract final class ObjCBlock_IntBlock_IntBlock {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>
fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) =>
objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>(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<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>
fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<IntBlock Function(IntBlock arg0)>> ptr,
) =>
objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>(
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<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>
fromFunction(
DartIntBlock Function(DartIntBlock) fn, {
bool keepIsolateAlive = true,
}) =>
objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
>(
objc.newClosureBlock(
_closureCallable,
(IntBlock arg0) => fn(
ObjCBlock_Int32_Int32.fromPointer(
arg0,
retain: true,
release: true,
),
).ref.retainAndAutorelease(),
keepIsolateAlive,
),
retain: false,
release: true,
);
static IntBlock _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
) => block.ref.target
.cast<ffi.NativeFunction<IntBlock Function(IntBlock arg0)>>()
.asFunction<IntBlock Function(IntBlock)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
IntBlock Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>(_fnPtrTrampoline)
.cast();
static IntBlock _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
) => (objc.getBlockClosure(block) as IntBlock Function(IntBlock))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
IntBlock Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)>`.
extension ObjCBlock_IntBlock_IntBlock$CallExtension
on
objc.ObjCBlock<
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)> Function(
objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>,
)
> {
DartIntBlock call(DartIntBlock arg0) => ObjCBlock_Int32_Int32.fromPointer(
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
IntBlock Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
)
>
>()
.asFunction<
IntBlock Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>()(ref.pointer, arg0.ref.pointer),
retain: true,
release: true,
);
}
/// Construction methods for `objc.ObjCBlock<objc.NSString? Function(objc.NSString?)>`.
abstract final class ObjCBlock_NSString_NSString {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<objc.NSString? Function(objc.NSString?)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<objc.NSString? Function(objc.NSString?)>(
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<objc.NSString? Function(objc.NSString?)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>
ptr,
) => objc.ObjCBlock<objc.NSString? Function(objc.NSString?)>(
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<objc.NSString? Function(objc.NSString?)> fromFunction(
objc.NSString? Function(objc.NSString?) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<objc.NSString? Function(objc.NSString?)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(
arg0.address == 0
? null
: objc.NSString.fromPointer(arg0, retain: true, release: true),
)?.ref.retainAndAutorelease() ??
ffi.nullptr,
keepIsolateAlive,
),
retain: false,
release: true,
);
static ffi.Pointer<objc.ObjCObjectImpl> _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static ffi.Pointer<objc.ObjCObjectImpl> _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<objc.NSString? Function(objc.NSString?)>`.
extension ObjCBlock_NSString_NSString$CallExtension
on objc.ObjCBlock<objc.NSString? Function(objc.NSString?)> {
objc.NSString? call(objc.NSString? arg0) =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr)
.address ==
0
? null
: objc.NSString.fromPointer(
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr),
retain: true,
release: true,
);
}
/// Construction methods for `objc.ObjCBlock<Vec4 Function(Vec4)>`.
abstract final class ObjCBlock_Vec4_Vec4 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<Vec4 Function(Vec4)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<Vec4 Function(Vec4)>(
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<Vec4 Function(Vec4)> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<Vec4 Function(Vec4 arg0)>> ptr,
) => objc.ObjCBlock<Vec4 Function(Vec4)>(
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<Vec4 Function(Vec4)> fromFunction(
Vec4 Function(Vec4) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<Vec4 Function(Vec4)>(
objc.newClosureBlock(
_closureCallable,
(Vec4 arg0) => fn(arg0),
keepIsolateAlive,
),
retain: false,
release: true,
);
static Vec4 _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec4 arg0,
) => block.ref.target
.cast<ffi.NativeFunction<Vec4 Function(Vec4 arg0)>>()
.asFunction<Vec4 Function(Vec4)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
Vec4 Function(ffi.Pointer<objc.ObjCBlockImpl>, Vec4)
>(_fnPtrTrampoline)
.cast();
static Vec4 _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec4 arg0,
) => (objc.getBlockClosure(block) as Vec4 Function(Vec4))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
Vec4 Function(ffi.Pointer<objc.ObjCBlockImpl>, Vec4)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<Vec4 Function(Vec4)>`.
extension ObjCBlock_Vec4_Vec4$CallExtension
on objc.ObjCBlock<Vec4 Function(Vec4)> {
Vec4 call(Vec4 arg0) =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
Vec4 Function(ffi.Pointer<objc.ObjCBlockImpl> block, Vec4 arg0)
>
>()
.asFunction<Vec4 Function(ffi.Pointer<objc.ObjCBlockImpl>, Vec4)>()(
ref.pointer,
arg0,
);
}
/// Construction methods for `objc.ObjCBlock<ffi.Double Function(ffi.Double)>`.
abstract final class ObjCBlock_ffiDouble_ffiDouble {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Double Function(ffi.Double)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Double Function(ffi.Double)>(
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.Double Function(ffi.Double)> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Double Function(ffi.Double arg0)>> ptr,
) => objc.ObjCBlock<ffi.Double Function(ffi.Double)>(
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.Double Function(ffi.Double)> fromFunction(
double Function(double) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Double Function(ffi.Double)>(
objc.newClosureBlock(
_closureCallable,
(double arg0) => fn(arg0),
keepIsolateAlive,
),
retain: false,
release: true,
);
static double _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
double arg0,
) => block.ref.target
.cast<ffi.NativeFunction<ffi.Double Function(ffi.Double arg0)>>()
.asFunction<double Function(double)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Double Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Double)
>(_fnPtrTrampoline, 0.0)
.cast();
static double _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
double arg0,
) => (objc.getBlockClosure(block) as double Function(double))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Double Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Double)
>(_closureTrampoline, 0.0)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Double Function(ffi.Double)>`.
extension ObjCBlock_ffiDouble_ffiDouble$CallExtension
on objc.ObjCBlock<ffi.Double Function(ffi.Double)> {
double call(double arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Double Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Double arg0,
)
>
>()
.asFunction<
double Function(ffi.Pointer<objc.ObjCBlockImpl>, double)
>()(ref.pointer, arg0);
}
/// Construction methods for `objc.ObjCBlock<ffi.Float Function(ffi.Float)>`.
abstract final class ObjCBlock_ffiFloat_ffiFloat {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Float Function(ffi.Float)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Float Function(ffi.Float)>(
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.Float Function(ffi.Float)> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Float Function(ffi.Float arg0)>> ptr,
) => objc.ObjCBlock<ffi.Float Function(ffi.Float)>(
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.Float Function(ffi.Float)> fromFunction(
double Function(double) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Float Function(ffi.Float)>(
objc.newClosureBlock(
_closureCallable,
(double arg0) => fn(arg0),
keepIsolateAlive,
),
retain: false,
release: true,
);
static double _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
double arg0,
) => block.ref.target
.cast<ffi.NativeFunction<ffi.Float Function(ffi.Float arg0)>>()
.asFunction<double Function(double)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Float Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Float)
>(_fnPtrTrampoline, 0.0)
.cast();
static double _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
double arg0,
) => (objc.getBlockClosure(block) as double Function(double))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Float Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Float)
>(_closureTrampoline, 0.0)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Float Function(ffi.Float)>`.
extension ObjCBlock_ffiFloat_ffiFloat$CallExtension
on objc.ObjCBlock<ffi.Float Function(ffi.Float)> {
double call(double arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Float Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Float arg0,
)
>
>()
.asFunction<
double Function(ffi.Pointer<objc.ObjCBlockImpl>, double)
>()(ref.pointer, arg0);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function()>`.
abstract final class ObjCBlock_ffiVoid {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function()> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function()>(
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()> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> ptr,
) => objc.ObjCBlock<ffi.Void Function()>(
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()> fromFunction(
void Function() fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function()>(
objc.newClosureBlock(_closureCallable, () => fn(), 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()> listener(
void Function() fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
() => fn(),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_1pl9qdv(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function()>(
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()> blocking(
void Function() fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
() => fn(),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
() => fn(),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_1pl9qdv(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function()>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(ffi.Pointer<objc.ObjCBlockImpl> block) {
(objc.getBlockClosure(block) as void Function())();
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> 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<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Void>)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Void>)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(ffi.Pointer<objc.ObjCBlockImpl> block) => block
.ref
.target
.cast<ffi.NativeFunction<ffi.Void Function()>>()
.asFunction<void Function()>()();
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(ffi.Pointer<objc.ObjCBlockImpl> block) =>
(objc.getBlockClosure(block) as void Function())();
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function()>`.
extension ObjCBlock_ffiVoid$CallExtension
on objc.ObjCBlock<ffi.Void Function()> {
void call() =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> block)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCBlockImpl>)>()(
ref.pointer,
);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(DummyObject)>`.
abstract final class ObjCBlock_ffiVoid_DummyObject {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(DummyObject)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(DummyObject)>(
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(DummyObject)> fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(DummyObject)>(
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(DummyObject)> fromFunction(
void Function(DummyObject) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(DummyObject)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(DummyObject.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<ffi.Void Function(DummyObject)> listener(
void Function(DummyObject) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(DummyObject.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_xtuoz7(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(DummyObject)>(
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(DummyObject)> blocking(
void Function(DummyObject) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(DummyObject.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(DummyObject.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_xtuoz7(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(DummyObject)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
try {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCObjectImpl>)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(DummyObject)>`.
extension ObjCBlock_ffiVoid_DummyObject$CallExtension
on objc.ObjCBlock<ffi.Void Function(DummyObject)> {
void call(DummyObject arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0.ref.pointer);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(DummyObject?)>`.
abstract final class ObjCBlock_ffiVoid_DummyObject$1 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(DummyObject?)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(DummyObject?)>(
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(DummyObject?)> fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(DummyObject?)>(
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(DummyObject?)> fromFunction(
void Function(DummyObject?) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(DummyObject?)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) => fn(
arg0.address == 0
? null
: DummyObject.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<ffi.Void Function(DummyObject?)> listener(
void Function(DummyObject?) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) => fn(
arg0.address == 0
? null
: DummyObject.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_xtuoz7(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(DummyObject?)>(
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(DummyObject?)> blocking(
void Function(DummyObject?) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) => fn(
arg0.address == 0
? null
: DummyObject.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) => fn(
arg0.address == 0
? null
: DummyObject.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_xtuoz7(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(DummyObject?)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
try {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCObjectImpl>)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(DummyObject?)>`.
extension ObjCBlock_ffiVoid_DummyObject$1$CallExtension
on objc.ObjCBlock<ffi.Void Function(DummyObject?)> {
void call(DummyObject? arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Int32)>`.
abstract final class ObjCBlock_ffiVoid_Int32 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(ffi.Int32)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Int32)>(
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(ffi.Int32)> fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Int32 arg0)>> ptr,
) => objc.ObjCBlock<ffi.Void Function(ffi.Int32)>(
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(ffi.Int32)> fromFunction(
void Function(int) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Int32)>(
objc.newClosureBlock(
_closureCallable,
(int 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<ffi.Void Function(ffi.Int32)> listener(
void Function(int) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(int arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_1bqef4y(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Int32)>(
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.Int32)> blocking(
void Function(int) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(int arg0) => fn(arg0),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(int arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_1bqef4y(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Int32)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
) {
(objc.getBlockClosure(block) as void Function(int))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> 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<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
) => block.ref.target
.cast<ffi.NativeFunction<ffi.Void Function(ffi.Int32 arg0)>>()
.asFunction<void Function(int)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
) => (objc.getBlockClosure(block) as void Function(int))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Int32)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Int32)>`.
extension ObjCBlock_ffiVoid_Int32$CallExtension
on objc.ObjCBlock<ffi.Void Function(ffi.Int32)> {
void call(int arg0) =>
ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Int32 arg0,
)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCBlockImpl>, int)>()(
ref.pointer,
arg0,
);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>`.
abstract final class ObjCBlock_ffiVoid_Int32$1 {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>(
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(ffi.Pointer<ffi.Int32>)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Int32> arg0)>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>(
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(ffi.Pointer<ffi.Int32>)> fromFunction(
void Function(ffi.Pointer<ffi.Int32>) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<ffi.Int32> 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<ffi.Void Function(ffi.Pointer<ffi.Int32>)> listener(
void Function(ffi.Pointer<ffi.Int32>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(ffi.Pointer<ffi.Int32> arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_yhkuco(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>(
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<ffi.Int32>)> blocking(
void Function(ffi.Pointer<ffi.Int32>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(ffi.Pointer<ffi.Int32> arg0) => fn(arg0),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(ffi.Pointer<ffi.Int32> arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_yhkuco(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Int32> arg0,
) {
(objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Int32>))(
arg0,
);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Int32>)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Int32>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<ffi.Int32> arg0,
) {
try {
(objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Int32>))(
arg0,
);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Int32>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Int32>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Int32>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Int32>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Int32> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Int32> arg0)>
>()
.asFunction<void Function(ffi.Pointer<ffi.Int32>)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Int32>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Int32> arg0,
) => (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Int32>))(
arg0,
);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Int32>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)>`.
extension ObjCBlock_ffiVoid_Int32$1$CallExtension
on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Int32>)> {
void call(ffi.Pointer<ffi.Int32> arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Int32> arg0,
)
>
>()
.asFunction<
void Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Int32>)
>()(ref.pointer, arg0);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>`.
abstract final class ObjCBlock_ffiVoid_Int32_Vec4_ffiChar {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<
ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>
fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) =>
objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>(
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(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(ffi.Int32 arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2)
>
>
ptr,
) =>
objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>(
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(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>
fromFunction(
void Function(int, Vec4, ffi.Pointer<ffi.Char>) fn, {
bool keepIsolateAlive = true,
}) =>
objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>(
objc.newClosureBlock(
_closureCallable,
(int arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2) =>
fn(arg0, arg1, arg2),
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(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>
listener(
void Function(int, Vec4, ffi.Pointer<ffi.Char>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(int arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2) => fn(arg0, arg1, arg2),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_li50va(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<
ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>(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.Int32, Vec4, ffi.Pointer<ffi.Char>)
>
blocking(
void Function(int, Vec4, ffi.Pointer<ffi.Char>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(int arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2) => fn(arg0, arg1, arg2),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(int arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2) => fn(arg0, arg1, arg2),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_li50va(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<
ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
>(wrapper, retain: false, release: true);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
) {
(objc.getBlockClosure(block)
as void Function(int, Vec4, ffi.Pointer<ffi.Char>))(arg0, arg1, arg2);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
int arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
) {
try {
(objc.getBlockClosure(block)
as void Function(int, Vec4, ffi.Pointer<ffi.Char>))(arg0, arg1, arg2);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
) =>
block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int32 arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
)
>
>()
.asFunction<void Function(int, Vec4, ffi.Pointer<ffi.Char>)>()(
arg0,
arg1,
arg2,
);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
int arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
) =>
(objc.getBlockClosure(block)
as void Function(int, Vec4, ffi.Pointer<ffi.Char>))(arg0, arg1, arg2);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int32,
Vec4,
ffi.Pointer<ffi.Char>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)>`.
extension ObjCBlock_ffiVoid_Int32_Vec4_ffiChar$CallExtension
on
objc.ObjCBlock<
ffi.Void Function(ffi.Int32, Vec4, ffi.Pointer<ffi.Char>)
> {
void call(int arg0, Vec4 arg1, ffi.Pointer<ffi.Char> arg2) => ref
.pointer
.ref
.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Int32 arg0,
Vec4 arg1,
ffi.Pointer<ffi.Char> arg2,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
int,
Vec4,
ffi.Pointer<ffi.Char>,
)
>()(ref.pointer, arg0, arg1, arg2);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)>`.
abstract final class ObjCBlock_ffiVoid_IntBlock {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>
fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) =>
objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>(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.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>
fromFunctionPointer(
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(IntBlock arg0)>> ptr,
) =>
objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>(
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.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>
fromFunction(
void Function(DartIntBlock) fn, {
bool keepIsolateAlive = true,
}) =>
objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>(
objc.newClosureBlock(
_closureCallable,
(IntBlock arg0) => fn(
ObjCBlock_Int32_Int32.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<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>
listener(void Function(DartIntBlock) fn, {bool keepIsolateAlive = true}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(IntBlock arg0) => fn(
ObjCBlock_Int32_Int32.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_f167m6(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>(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.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>
blocking(void Function(DartIntBlock) fn, {bool keepIsolateAlive = true}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(IntBlock arg0) => fn(
ObjCBlock_Int32_Int32.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(IntBlock arg0) => fn(
ObjCBlock_Int32_Int32.fromPointer(arg0, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_f167m6(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
>(wrapper, retain: false, release: true);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
) {
(objc.getBlockClosure(block) as void Function(IntBlock))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
IntBlock arg0,
) {
try {
(objc.getBlockClosure(block) as void Function(IntBlock))(arg0);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
IntBlock,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
IntBlock,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
IntBlock,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
IntBlock,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
) => block.ref.target
.cast<ffi.NativeFunction<ffi.Void Function(IntBlock arg0)>>()
.asFunction<void Function(IntBlock)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
) => (objc.getBlockClosure(block) as void Function(IntBlock))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)>`.
extension ObjCBlock_ffiVoid_IntBlock$CallExtension
on
objc.ObjCBlock<
ffi.Void Function(objc.ObjCBlock<ffi.Int32 Function(ffi.Int32)>)
> {
void call(DartIntBlock arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
IntBlock arg0,
)
>
>()
.asFunction<
void Function(ffi.Pointer<objc.ObjCBlockImpl>, IntBlock)
>()(ref.pointer, arg0.ref.pointer);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(objc.NSString)>`.
abstract final class ObjCBlock_ffiVoid_NSString {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(objc.NSString)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
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.NSString)> fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
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.NSString)> fromFunction(
void Function(objc.NSString) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(objc.NSString.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<ffi.Void Function(objc.NSString)> listener(
void Function(objc.NSString) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(objc.NSString.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_xtuoz7(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
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.NSString)> blocking(
void Function(objc.NSString) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(objc.NSString.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCObjectImpl> arg0) =>
fn(objc.NSString.fromPointer(arg0, retain: false, release: true)),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_xtuoz7(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
try {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCObjectImpl>)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(objc.NSString)>`.
extension ObjCBlock_ffiVoid_NSString$CallExtension
on objc.ObjCBlock<ffi.Void Function(objc.NSString)> {
void call(objc.NSString arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0.ref.pointer);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>`.
abstract final class ObjCBlock_ffiVoid_Vec2_Vec4_NSObject {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>
fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>(
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(Vec2, Vec4, objc.NSObject)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
)
>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>(
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(Vec2, Vec4, objc.NSObject)>
fromFunction(
void Function(Vec2, Vec4, objc.NSObject) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>(
objc.newClosureBlock(
_closureCallable,
(Vec2 arg0, Vec4 arg1, ffi.Pointer<objc.ObjCObjectImpl> arg2) => fn(
arg0,
arg1,
objc.NSObject.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(Vec2, Vec4, objc.NSObject)> listener(
void Function(Vec2, Vec4, objc.NSObject) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(Vec2 arg0, Vec4 arg1, ffi.Pointer<objc.ObjCObjectImpl> arg2) => fn(
arg0,
arg1,
objc.NSObject.fromPointer(arg2, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_ru30ue(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>(
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(Vec2, Vec4, objc.NSObject)> blocking(
void Function(Vec2, Vec4, objc.NSObject) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(Vec2 arg0, Vec4 arg1, ffi.Pointer<objc.ObjCObjectImpl> arg2) => fn(
arg0,
arg1,
objc.NSObject.fromPointer(arg2, retain: false, release: true),
),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(Vec2 arg0, Vec4 arg1, ffi.Pointer<objc.ObjCObjectImpl> arg2) => fn(
arg0,
arg1,
objc.NSObject.fromPointer(arg2, retain: false, release: true),
),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_ru30ue(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
) {
(objc.getBlockClosure(block)
as void Function(Vec2, Vec4, ffi.Pointer<objc.ObjCObjectImpl>))(
arg0,
arg1,
arg2,
);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
) {
try {
(objc.getBlockClosure(block)
as void Function(Vec2, Vec4, ffi.Pointer<objc.ObjCObjectImpl>))(
arg0,
arg1,
arg2,
);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
)
>
>()
.asFunction<
void Function(Vec2, Vec4, ffi.Pointer<objc.ObjCObjectImpl>)
>()(arg0, arg1, arg2);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
) =>
(objc.getBlockClosure(block)
as void Function(Vec2, Vec4, ffi.Pointer<objc.ObjCObjectImpl>))(
arg0,
arg1,
arg2,
);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>`.
extension ObjCBlock_ffiVoid_Vec2_Vec4_NSObject$CallExtension
on objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)> {
void call(Vec2 arg0, Vec4 arg1, objc.NSObject arg2) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
Vec2 arg0,
Vec4 arg1,
ffi.Pointer<objc.ObjCObjectImpl> arg2,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
Vec2,
Vec4,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>()(ref.pointer, arg0, arg1, arg2.ref.pointer);
}
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>`.
abstract final class ObjCBlock_ffiVoid_objcObjCSelector {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>
fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>(
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(ffi.Pointer<objc.ObjCSelector>)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCSelector> arg0)>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>(
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(ffi.Pointer<objc.ObjCSelector>)>
fromFunction(
void Function(ffi.Pointer<objc.ObjCSelector>) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>(
objc.newClosureBlock(
_closureCallable,
(ffi.Pointer<objc.ObjCSelector> 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<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>
listener(
void Function(ffi.Pointer<objc.ObjCSelector>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_listenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCSelector> arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapListenerBlock_1d9e4oe(raw);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>(
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<objc.ObjCSelector>)>
blocking(
void Function(ffi.Pointer<objc.ObjCSelector>) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(
_blockingCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCSelector> arg0) => fn(arg0),
keepIsolateAlive,
);
final rawListener = objc.newClosureBlock(
_blockingListenerCallable.nativeFunction.cast(),
(ffi.Pointer<objc.ObjCSelector> arg0) => fn(arg0),
keepIsolateAlive,
);
final wrapper = _18tji2r_wrapBlockingBlock_1d9e4oe(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
objc.objectRelease(rawListener.cast());
return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>(
wrapper,
retain: false,
release: true,
);
}
static void _listenerTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCSelector> arg0,
) {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCSelector>))(arg0);
objc.objectRelease(block.cast());
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
_listenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>.listener(_listenerTrampoline)
..keepIsolateAlive = false;
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCSelector> arg0,
) {
try {
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCSelector>))(arg0);
} catch (e) {
} finally {
objc.signalWaiter(waiter);
objc.objectRelease(block.cast());
}
}
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCSelector>,
)
>
_blockingCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCSelector>,
)
>.isolateLocal(_blockingTrampoline)
..keepIsolateAlive = false;
static ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCSelector>,
)
>
_blockingListenerCallable =
ffi.NativeCallable<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<objc.ObjCSelector>,
)
>.listener(_blockingTrampoline)
..keepIsolateAlive = false;
static void _fnPtrTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCSelector> arg0,
) => block.ref.target
.cast<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCSelector> arg0)
>
>()
.asFunction<void Function(ffi.Pointer<objc.ObjCSelector>)>()(arg0);
static ffi.Pointer<ffi.Void> _fnPtrCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>(_fnPtrTrampoline)
.cast();
static void _closureTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCSelector> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCSelector>))(arg0);
static ffi.Pointer<ffi.Void> _closureCallable =
ffi.Pointer.fromFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>(_closureTrampoline)
.cast();
}
/// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>`.
extension ObjCBlock_ffiVoid_objcObjCSelector$CallExtension
on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)> {
void call(ffi.Pointer<objc.ObjCSelector> arg0) => ref.pointer.ref.invoke
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<objc.ObjCSelector> arg0,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>()(ref.pointer, arg0);
}
typedef ObjectBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartObjectBlock = objc.ObjCBlock<DummyObject Function(DummyObject)>;
typedef ObjectListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartObjectListenerBlock =
objc.ObjCBlock<ffi.Void Function(DummyObject)>;
typedef SelectorBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartSelectorBlock =
objc.ObjCBlock<ffi.Void Function(ffi.Pointer<objc.ObjCSelector>)>;
typedef StructListenerBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartStructListenerBlock =
objc.ObjCBlock<ffi.Void Function(Vec2, Vec4, objc.NSObject)>;
final class Vec2 extends ffi.Struct {
@ffi.Double()
external double x;
@ffi.Double()
external double y;
static ffi.Pointer<Vec2> $allocate(
ffi.Allocator $allocator, {
required double x,
required double y,
}) => $allocator<Vec2>()
..ref.x = x
..ref.y = y;
}
final class Vec4 extends ffi.Struct {
@ffi.Double()
external double x;
@ffi.Double()
external double y;
@ffi.Double()
external double z;
@ffi.Double()
external double w;
static ffi.Pointer<Vec4> $allocate(
ffi.Allocator $allocator, {
required double x,
required double y,
required double z,
required double w,
}) => $allocator<Vec4>()
..ref.x = x
..ref.y = y
..ref.z = z
..ref.w = w;
}
typedef Vec4Block = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartVec4Block = objc.ObjCBlock<Vec4 Function(Vec4)>;
typedef VoidBlock = ffi.Pointer<objc.ObjCBlockImpl>;
typedef DartVoidBlock = objc.ObjCBlock<ffi.Void Function()>;
late final _class_BlockTester = objc.getClass("BlockTester");
late final _class_DummyObject = objc.getClass("DummyObject");
late final _class_NSThread = objc.getClass("NSThread");
final _objc_msgSend_129vhbw = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Int32>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Int32>,
)
>();
final _objc_msgSend_151sglz = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_18chyc = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Double,
)
>
>()
.asFunction<
bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
double,
)
>();
final _objc_msgSend_18yul99 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_19nvye5 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
>()
.asFunction<
bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>();
final _objc_msgSend_1cwp428 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.NSZone>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.NSZone>,
)
>();
final _objc_msgSend_1eldwyi = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>();
final _objc_msgSend_1gew1vm = objc.msgSendPointer
.cast<
ffi.NativeFunction<
Vec4 Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
Vec4 Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_1gew1vmStret = objc.msgSendStretPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<Vec4>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<Vec4>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_1i9r4xy = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.UnsignedLong,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
final _objc_msgSend_1pl9qdv = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_1ukqyt8 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer
.cast<
ffi.NativeFunction<
ffi.Double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_8mj2fv = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_8mj2fvFpret = objc.msgSendFpretPointer
.cast<
ffi.NativeFunction<
ffi.Double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_91o635 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
bool Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_aclumu = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Int32,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
final _objc_msgSend_f167m6 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_hwm8nu = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Double,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
double,
)
>();
final _objc_msgSend_jevgay = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
int,
)
>();
final _objc_msgSend_lzbvjm = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>();
final _objc_msgSend_n2da1l = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Long,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
final _objc_msgSend_nnxkei = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCObjectImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_o8bnms = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Float Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_o8bnmsFpret = objc.msgSendFpretPointer
.cast<
ffi.NativeFunction<
ffi.Float Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
double Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
final _objc_msgSend_oi8iq9 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Long Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
int Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_ovsamd = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Void>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Void>,
)
>();
final _objc_msgSend_po4t03 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
ffi.Int32,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCBlockImpl>,
int,
)
>();
final _objc_msgSend_uwvaik = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_w43bzz = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Int,
)
>
>()
.asFunction<
ffi.Pointer<objc.ObjCBlockImpl> Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
final _objc_msgSend_xtuoz7 = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
)
>();
final _objc_msgSend_xw2lbc = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.UnsignedLong Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>
>()
.asFunction<
int Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
)
>();
final _objc_msgSend_yhkuco = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Int32>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<ffi.Int32>,
)
>();
final _objc_msgSend_zo3bvx = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Int32 Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Int32,
)
>
>()
.asFunction<
int Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
late final _sel_alloc = objc.registerName("alloc");
late final _sel_allocWithZone_ = objc.registerName("allocWithZone:");
late final _sel_blockingBlockTest_resultBlock_ = objc.registerName(
"blockingBlockTest:resultBlock:",
);
late final _sel_callDoubleBlock_ = objc.registerName("callDoubleBlock:");
late final _sel_callFloatBlock_ = objc.registerName("callFloatBlock:");
late final _sel_callListener_ = objc.registerName("callListener:");
late final _sel_callNSStringListener_x_ = objc.registerName(
"callNSStringListener:x:",
);
late final _sel_callNoTrampolineListener_ = objc.registerName(
"callNoTrampolineListener:",
);
late final _sel_callNullableListener_ = objc.registerName(
"callNullableListener:",
);
late final _sel_callNullableObjectBlock_ = objc.registerName(
"callNullableObjectBlock:",
);
late final _sel_callNullableStringBlock_ = objc.registerName(
"callNullableStringBlock:",
);
late final _sel_callObjectBlock_ = objc.registerName("callObjectBlock:");
late final _sel_callObjectListener_ = objc.registerName("callObjectListener:");
late final _sel_callOnNewThread_ = objc.registerName("callOnNewThread:");
late final _sel_callOnSameThreadOutsideIsolate_ = objc.registerName(
"callOnSameThreadOutsideIsolate:",
);
late final _sel_callOnSameThread_ = objc.registerName("callOnSameThread:");
late final _sel_callSelectorBlock_ = objc.registerName("callSelectorBlock:");
late final _sel_callStackReturnAddresses = objc.registerName(
"callStackReturnAddresses",
);
late final _sel_callStackSymbols = objc.registerName("callStackSymbols");
late final _sel_callStructListener_ = objc.registerName("callStructListener:");
late final _sel_callVec4Block_ = objc.registerName("callVec4Block:");
late final _sel_callWithBlockOnNewThread_ = objc.registerName(
"callWithBlockOnNewThread:",
);
late final _sel_call_ = objc.registerName("call:");
late final _sel_cancel = objc.registerName("cancel");
late final _sel_currentThread = objc.registerName("currentThread");
late final _sel_dealloc = objc.registerName("dealloc");
late final _sel_detachNewThreadSelector_toTarget_withObject_ = objc
.registerName("detachNewThreadSelector:toTarget:withObject:");
late final _sel_detachNewThreadWithBlock_ = objc.registerName(
"detachNewThreadWithBlock:",
);
late final _sel_exit = objc.registerName("exit");
late final _sel_getBlock = objc.registerName("getBlock");
late final _sel_init = objc.registerName("init");
late final _sel_initWithBlock_ = objc.registerName("initWithBlock:");
late final _sel_initWithCounter_ = objc.registerName("initWithCounter:");
late final _sel_initWithTarget_selector_object_ = objc.registerName(
"initWithTarget:selector:object:",
);
late final _sel_invokeAndReleaseListenerOnNewThread = objc.registerName(
"invokeAndReleaseListenerOnNewThread",
);
late final _sel_invokeAndReleaseListener_ = objc.registerName(
"invokeAndReleaseListener:",
);
late final _sel_isCancelled = objc.registerName("isCancelled");
late final _sel_isExecuting = objc.registerName("isExecuting");
late final _sel_isFinished = objc.registerName("isFinished");
late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:");
late final _sel_isMainThread = objc.registerName("isMainThread");
late final _sel_isMultiThreaded = objc.registerName("isMultiThreaded");
late final _sel_main = objc.registerName("main");
late final _sel_mainThread = objc.registerName("mainThread");
late final _sel_name = objc.registerName("name");
late final _sel_new = objc.registerName("new");
late final _sel_newBlockBlock_ = objc.registerName("newBlockBlock:");
late final _sel_newBlock_withMult_ = objc.registerName("newBlock:withMult:");
late final _sel_newFromBlock_ = objc.registerName("newFromBlock:");
late final _sel_newFromListener_ = objc.registerName("newFromListener:");
late final _sel_newFromMultiplier_ = objc.registerName("newFromMultiplier:");
late final _sel_newWithCounter_ = objc.registerName("newWithCounter:");
late final _sel_pokeBlock = objc.registerName("pokeBlock");
late final _sel_qualityOfService = objc.registerName("qualityOfService");
late final _sel_setCounter_ = objc.registerName("setCounter:");
late final _sel_setName_ = objc.registerName("setName:");
late final _sel_setQualityOfService_ = objc.registerName(
"setQualityOfService:",
);
late final _sel_setStackSize_ = objc.registerName("setStackSize:");
late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:");
late final _sel_setup_ = objc.registerName("setup:");
late final _sel_sleepForTimeInterval_ = objc.registerName(
"sleepForTimeInterval:",
);
late final _sel_sleepUntilDate_ = objc.registerName("sleepUntilDate:");
late final _sel_stackSize = objc.registerName("stackSize");
late final _sel_start = objc.registerName("start");
late final _sel_threadDictionary = objc.registerName("threadDictionary");
late final _sel_threadPriority = objc.registerName("threadPriority");
typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>;
typedef Dartinstancetype = objc.ObjCObject;