blob: 3692bed4db4694732a0a6bad7a79b01cd18fa756 [file] [edit]
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// coverage:ignore-file
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint, unused_import, unused_element, deprecated_member_use_from_same_package
import 'dart:ffi' as ffi;
import 'dart:isolate' as isolate;
import 'package:objective_c/objective_c.dart' as objc;
import 'package:ffi/ffi.dart' as pkg_ffi;
const _$objcVersionCheck = objc.ObjCVersionCheck(9, 4);
@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> _17w5sbb_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>)
>(isLeaf: true)
external ffi.Pointer<objc.ObjCBlockImpl> _17w5sbb_wrapListenerBlock_xtuoz7(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
/// Construction methods for `objc.ObjCBlock<ffi.Void Function(objc.NSObject?)>`.
abstract final class ObjCBlock_ffiVoid_NSObject {
/// Returns a block that wraps the given raw block pointer.
static objc.ObjCBlock<ffi.Void Function(objc.NSObject?)> fromPointer(
ffi.Pointer<objc.ObjCBlockImpl> pointer, {
bool retain = false,
bool release = false,
}) => objc.ObjCBlock<ffi.Void Function(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(objc.NSObject?)> fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> arg0)
>
>
ptr,
) => objc.ObjCBlock<ffi.Void Function(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(objc.NSObject?)> fromFunction(
void Function(objc.NSObject?) fn, {
bool keepIsolateAlive = true,
}) => objc.ObjCBlock<ffi.Void Function(objc.NSObject?)>(
objc.newClosureBlock(_closureCallable, (
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
return fn(
arg0.address == 0
? null
: objc.NSObject.fromPointer(arg0, retain: true, release: true),
);
}, keepIsolateAlive),
retain: false,
release: true,
);
/// Creates a listener block from a Dart function.
///
/// This is based on RawReceivePort, 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.
///
/// 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.NSObject?)> listener(
void Function(objc.NSObject?) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newPortBlock(
ffi.Native.addressOf<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>
>(_17w5sbb_1cgmns7_portBlockInvoke)
.cast(),
(int msg) {
final rawMsg = ffi.Pointer.fromAddress(msg).cast<objc.ObjCObjectImpl>();
try {
final args = objc.NSObject.fromPointer(
rawMsg,
retain: false,
release: false,
);
final raw = args.ref.pointer;
fn(
_17w5sbb_BlockArgs_1cgmns7_getArg0(raw).address == 0
? null
: objc.NSObject.fromPointer(
_17w5sbb_BlockArgs_1cgmns7_getArg0(raw),
retain: true,
release: true,
),
);
} finally {
_17w5sbb_BlockArgs_1cgmns7_free(rawMsg);
}
},
keepIsolateAlive: keepIsolateAlive,
);
return objc.ObjCBlock<ffi.Void Function(objc.NSObject?)>(
raw,
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.NSObject?)> blocking(
void Function(objc.NSObject?) fn, {
bool keepIsolateAlive = true,
}) {
final raw = objc.newClosureBlock(_blockingCallable.nativeFunction.cast(), (
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) {
return fn(
arg0.address == 0
? null
: objc.NSObject.fromPointer(arg0, retain: true, release: true),
);
}, keepIsolateAlive);
final rawListener = objc.newPortBlock(
ffi.Native.addressOf<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>
>(_17w5sbb_1cgmns7_portBlockInvoke_blocking)
.cast(),
(int msg) {
final rawMsg = ffi.Pointer.fromAddress(msg).cast<objc.ObjCObjectImpl>();
try {
final args = objc.NSObject.fromPointer(
rawMsg,
retain: false,
release: false,
);
final raw = args.ref.pointer;
fn(
_17w5sbb_BlockArgs_1cgmns7_blocking_getArg0(raw).address == 0
? null
: objc.NSObject.fromPointer(
_17w5sbb_BlockArgs_1cgmns7_blocking_getArg0(raw),
retain: true,
release: true,
),
);
} catch (e) {
} finally {
_17w5sbb_BlockArgs_1cgmns7_blocking_free(rawMsg);
}
},
keepIsolateAlive: keepIsolateAlive,
);
final wrapper = _17w5sbb_wrapBlockingBlock_xtuoz7(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(objc.NSObject?)>(
wrapper,
retain: false,
release: true,
);
}
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
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 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.NSObject?)>`.
extension ObjCBlock_ffiVoid_NSObject$CallExtension
on objc.ObjCBlock<ffi.Void Function(objc.NSObject?)> {
void call(objc.NSObject? arg0) {
final _$$ref = arg0?.ref;
return 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, _$$ref?.pointer ?? ffi.nullptr);
}
}
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1cgmns7_getBlock', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl> _17w5sbb_BlockArgs_1cgmns7_getBlock(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1cgmns7_getArg0', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl> _17w5sbb_BlockArgs_1cgmns7_getArg0(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1cgmns7_free',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1cgmns7_free(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)>(
symbol: '_17w5sbb_1cgmns7_portBlockInvoke',
isLeaf: true,
)
external void _17w5sbb_1cgmns7_portBlockInvoke(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1cgmns7_blocking_signalWaiter',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1cgmns7_blocking_signalWaiter(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1cgmns7_blocking_getBlock', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl>
_17w5sbb_BlockArgs_1cgmns7_blocking_getBlock(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1cgmns7_blocking_free',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1cgmns7_blocking_free(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1cgmns7_blocking_getArg0', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl>
_17w5sbb_BlockArgs_1cgmns7_blocking_getArg0(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)>(
symbol: '_17w5sbb_1cgmns7_portBlockInvoke_blocking',
isLeaf: true,
)
external void _17w5sbb_1cgmns7_portBlockInvoke_blocking(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
/// 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,
) {
return 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 RawReceivePort, 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.
///
/// 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.newPortBlock(
ffi.Native.addressOf<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>
>(_17w5sbb_1nfopnd_portBlockInvoke)
.cast(),
(int msg) {
final rawMsg = ffi.Pointer.fromAddress(msg).cast<objc.ObjCObjectImpl>();
try {
final args = objc.NSObject.fromPointer(
rawMsg,
retain: false,
release: false,
);
final raw = args.ref.pointer;
fn(
objc.NSString.fromPointer(
_17w5sbb_BlockArgs_1nfopnd_getArg0(
raw,
).cast<objc.ObjCObjectImpl>(),
retain: true,
release: true,
),
);
} finally {
_17w5sbb_BlockArgs_1nfopnd_free(rawMsg);
}
},
keepIsolateAlive: keepIsolateAlive,
);
return objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
raw,
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,
) {
return fn(objc.NSString.fromPointer(arg0, retain: true, release: true));
}, keepIsolateAlive);
final rawListener = objc.newPortBlock(
ffi.Native.addressOf<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)
>
>(_17w5sbb_1nfopnd_portBlockInvoke_blocking)
.cast(),
(int msg) {
final rawMsg = ffi.Pointer.fromAddress(msg).cast<objc.ObjCObjectImpl>();
try {
final args = objc.NSObject.fromPointer(
rawMsg,
retain: false,
release: false,
);
final raw = args.ref.pointer;
fn(
objc.NSString.fromPointer(
_17w5sbb_BlockArgs_1nfopnd_blocking_getArg0(
raw,
).cast<objc.ObjCObjectImpl>(),
retain: true,
release: true,
),
);
} catch (e) {
} finally {
_17w5sbb_BlockArgs_1nfopnd_blocking_free(rawMsg);
}
},
keepIsolateAlive: keepIsolateAlive,
);
final wrapper = _17w5sbb_wrapBlockingBlock_xtuoz7(
raw,
rawListener,
objc.objCContext,
);
objc.objectRelease(raw.cast());
return objc.ObjCBlock<ffi.Void Function(objc.NSString)>(
wrapper,
retain: false,
release: true,
);
}
static void _blockingTrampoline(
ffi.Pointer<objc.ObjCBlockImpl> block,
ffi.Pointer<ffi.Void> waiter,
ffi.Pointer<objc.ObjCObjectImpl> arg0,
) =>
(objc.getBlockClosure(block)
as void Function(ffi.Pointer<objc.ObjCObjectImpl>))(arg0);
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 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) {
final _$$ref = arg0.ref;
return 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, _$$ref.pointer);
}
}
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1nfopnd_getBlock', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl> _17w5sbb_BlockArgs_1nfopnd_getBlock(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1nfopnd_getArg0', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl> _17w5sbb_BlockArgs_1nfopnd_getArg0(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1nfopnd_free',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1nfopnd_free(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)>(
symbol: '_17w5sbb_1nfopnd_portBlockInvoke',
isLeaf: true,
)
external void _17w5sbb_1nfopnd_portBlockInvoke(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1nfopnd_blocking_signalWaiter',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1nfopnd_blocking_signalWaiter(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1nfopnd_blocking_getBlock', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl>
_17w5sbb_BlockArgs_1nfopnd_blocking_getBlock(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl>)>(
symbol: '_17w5sbb_BlockArgs_1nfopnd_blocking_free',
isLeaf: true,
)
external void _17w5sbb_BlockArgs_1nfopnd_blocking_free(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<
ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl>)
>(symbol: '_17w5sbb_BlockArgs_1nfopnd_blocking_getArg0', isLeaf: true)
external ffi.Pointer<objc.ObjCObjectImpl>
_17w5sbb_BlockArgs_1nfopnd_blocking_getArg0(
ffi.Pointer<objc.ObjCObjectImpl> peer,
);
@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl>)>(
symbol: '_17w5sbb_1nfopnd_portBlockInvoke_blocking',
isLeaf: true,
)
external void _17w5sbb_1nfopnd_portBlockInvoke_blocking(
ffi.Pointer<objc.ObjCBlockImpl> block,
);
/// TestMessageService
extension type TestMessageService._(objc.ObjCObject object$)
implements objc.ObjCObject, objc.NSObject {
/// Constructs a [TestMessageService] that points to the same underlying object as [other].
TestMessageService.as(objc.ObjCObject other) : object$ = other {
assert(isA(object$));
}
/// Constructs a [TestMessageService] that wraps the given raw object pointer.
TestMessageService.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 [TestMessageService].
static bool isA(objc.ObjCObject? obj) => obj == null
? false
: _objc_msgSend_19nvye5(
obj.ref.pointer,
_sel_isKindOfClass_,
_class_TestMessageService,
);
/// alloc
static TestMessageService alloc() {
final $ret = _objc_msgSend_151sglz(_class_TestMessageService, _sel_alloc);
return TestMessageService.fromPointer($ret, retain: false, release: true);
}
/// allocWithZone:
static TestMessageService allocWithZone(ffi.Pointer<objc.NSZone> zone) {
final $ret = _objc_msgSend_1cwp428(
_class_TestMessageService,
_sel_allocWithZone_,
zone,
);
return TestMessageService.fromPointer($ret, retain: false, release: true);
}
/// echoAsyncObjectWithAnObject:completionHandler:
static void echoAsyncObjectWithAnObject(
objc.NSObject anObject, {
required objc.ObjCBlock<ffi.Void Function(objc.NSObject?)>
completionHandler,
}) {
final _$$ref = anObject.ref;
final _$$ref$1 = completionHandler.ref;
_objc_msgSend_o762yo(
_class_TestMessageService,
_sel_echoAsyncObjectWithAnObject_completionHandler_,
_$$ref.pointer,
_$$ref$1.pointer,
);
}
/// fetchGreetingAsyncWithCompletionHandler:
static void fetchGreetingAsyncWithCompletionHandler(
objc.ObjCBlock<ffi.Void Function(objc.NSString)> completionHandler,
) {
final _$$ref = completionHandler.ref;
_objc_msgSend_f167m6(
_class_TestMessageService,
_sel_fetchGreetingAsyncWithCompletionHandler_,
_$$ref.pointer,
);
}
/// fetchGreetingWithCompletion:
static void fetchGreetingWithCompletion(
objc.ObjCBlock<ffi.Void Function(objc.NSString)> completion,
) {
final _$$ref = completion.ref;
_objc_msgSend_f167m6(
_class_TestMessageService,
_sel_fetchGreetingWithCompletion_,
_$$ref.pointer,
);
}
/// new
static TestMessageService new$() {
final $ret = _objc_msgSend_151sglz(_class_TestMessageService, _sel_new);
return TestMessageService.fromPointer($ret, retain: false, release: true);
}
/// Returns a new instance of TestMessageService constructed with the default `new` method.
TestMessageService() : this.as(new$().object$);
}
extension TestMessageService$Methods on TestMessageService {
/// init
TestMessageService init() {
final _$$ref = object$.ref;
objc.checkOsVersionInternal(
'TestMessageService.init',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 0, 0)),
);
final $ret = _objc_msgSend_151sglz(
_$$ref.retainAndReturnPointer(),
_sel_init,
);
return TestMessageService.fromPointer($ret, retain: false, release: true);
}
}
@ffi.Native<ffi.Pointer<objc.ObjCObjectImpl>>(
symbol: 'OBJC_CLASS_\$__TtC9callbacks18TestMessageService',
)
external ffi.Pointer<objc.ObjCObjectImpl> _class_TestMessageService_raw;
final _class_TestMessageService = objc.getClass(
"callbacks.TestMessageService",
() => ffi.Native.addressOf<ffi.Pointer<objc.ObjCObjectImpl>>(
_class_TestMessageService_raw,
).cast(),
);
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_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_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_o762yo = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>
>()
.asFunction<
void Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCBlockImpl>,
)
>();
late final _sel_alloc = objc.registerName("alloc");
late final _sel_allocWithZone_ = objc.registerName("allocWithZone:");
late final _sel_echoAsyncObjectWithAnObject_completionHandler_ = objc
.registerName("echoAsyncObjectWithAnObject:completionHandler:");
late final _sel_fetchGreetingAsyncWithCompletionHandler_ = objc.registerName(
"fetchGreetingAsyncWithCompletionHandler:",
);
late final _sel_fetchGreetingWithCompletion_ = objc.registerName(
"fetchGreetingWithCompletion:",
);
late final _sel_init = objc.registerName("init");
late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:");
late final _sel_new = objc.registerName("new");
typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>;
typedef Dartinstancetype = objc.ObjCObject;