| // Copyright (c) 2024, 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. | |
| // Bindings for `src/objective_c.h` etc. | |
| // Regenerate bindings with `dart run tool/ffigen.dart`. | |
| // 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 | |
| @ffi.DefaultAsset('package:objective_c/objective_c.dylib') | |
| library; | |
| import 'dart:ffi' as ffi; | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int64)>( | |
| symbol: 'DOBJC_attachPortBlockFinalizer', | |
| isLeaf: true, | |
| ) | |
| external void attachPortBlockFinalizer(ffi.Pointer<ffi.Void> block, int port); | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'DOBJC_awaitWaiter', | |
| ) | |
| external void awaitWaiter(ffi.Pointer<ffi.Void> waiter); | |
| @ffi.Native<ffi.Pointer<DOBJC_Context> Function()>( | |
| symbol: 'DOBJC_createContext', | |
| isLeaf: true, | |
| ) | |
| external ffi.Pointer<DOBJC_Context> createContext(); | |
| @ffi.Native<ffi.Void Function(Dart_FinalizableHandle, ffi.Handle)>( | |
| symbol: 'DOBJC_deleteFinalizableHandle', | |
| ) | |
| external void deleteFinalizableHandle( | |
| Dart_FinalizableHandle handle, | |
| Object owner, | |
| ); | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ObjCBlockImpl>)>( | |
| symbol: 'DOBJC_disposeObjCBlockWithClosure', | |
| ) | |
| external void disposeObjCBlockWithClosure(ffi.Pointer<ObjCBlockImpl> block); | |
| /// Returns the MacOS/iOS version we're running on. | |
| @ffi.Native<Version Function()>(symbol: 'DOBJC_getOsVesion', isLeaf: true) | |
| external Version getOsVesion(); | |
| @ffi.Native<ffi.IntPtr Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'DOBJC_initializeApi', | |
| isLeaf: true, | |
| ) | |
| external int initializeApi(ffi.Pointer<ffi.Void> data); | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Int64, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'DOBJC_invokeBlockingPortBlock') | |
| external void invokeBlockingPortBlock( | |
| int port, | |
| ffi.Pointer<ffi.Void> args, | |
| ffi.Pointer<ffi.Void> waiter, | |
| ); | |
| @ffi.Native<ffi.Void Function(ffi.Int64, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'DOBJC_invokeListenerPortBlock', | |
| ) | |
| external void invokeListenerPortBlock(int port, ffi.Pointer<ffi.Void> args); | |
| @ffi.Native<ffi.Bool Function(ffi.Pointer<ObjCBlockImpl>)>( | |
| symbol: 'DOBJC_isValidBlock', | |
| isLeaf: true, | |
| ) | |
| external bool isValidBlock(ffi.Pointer<ObjCBlockImpl> block); | |
| @ffi.Native<ffi.Pointer<ffi.Bool> Function(ffi.Handle)>( | |
| symbol: 'DOBJC_newFinalizableBool', | |
| ) | |
| external ffi.Pointer<ffi.Bool> newFinalizableBool(Object owner); | |
| @ffi.Native< | |
| Dart_FinalizableHandle Function(ffi.Handle, ffi.Pointer<ObjCObjectImpl>) | |
| >(symbol: 'DOBJC_newFinalizableHandle') | |
| external Dart_FinalizableHandle newFinalizableHandle( | |
| Object owner, | |
| ffi.Pointer<ObjCObjectImpl> object, | |
| ); | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function()>( | |
| symbol: 'DOBJC_newWaiter', | |
| isLeaf: true, | |
| ) | |
| external ffi.Pointer<ffi.Void> newWaiter(); | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'DOBJC_runOnMainThread', isLeaf: true) | |
| external void runOnMainThread( | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>> fn, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'DOBJC_signalWaiter', | |
| isLeaf: true, | |
| ) | |
| external void signalWaiter(ffi.Pointer<ffi.Void> waiter); | |
| final class DOBJC_Context extends ffi.Opaque {} | |
| typedef Dart_FinalizableHandle = ffi.Pointer<Dart_FinalizableHandle_>; | |
| final class Dart_FinalizableHandle_ extends ffi.Opaque {} | |
| const int ILLEGAL_PORT = 0; | |
| final class ObjCBlockDesc extends ffi.Struct { | |
| @ffi.UnsignedLong() | |
| external int reserved; | |
| @ffi.UnsignedLong() | |
| external int size; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ffi.Void> dst, ffi.Pointer<ffi.Void> src) | |
| > | |
| > | |
| copy_helper; | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> src)> | |
| > | |
| dispose_helper; | |
| external ffi.Pointer<ffi.Char> signature; | |
| static ffi.Pointer<ObjCBlockDesc> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int reserved, | |
| required int size, | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ffi.Void> dst, ffi.Pointer<ffi.Void> src) | |
| > | |
| > | |
| copy_helper, | |
| required ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> src)> | |
| > | |
| dispose_helper, | |
| required ffi.Pointer<ffi.Char> signature, | |
| }) => $allocator<ObjCBlockDesc>() | |
| ..ref.reserved = reserved | |
| ..ref.size = size | |
| ..ref.copy_helper = copy_helper | |
| ..ref.dispose_helper = dispose_helper | |
| ..ref.signature = signature; | |
| } | |
| final class ObjCBlockImpl extends ffi.Struct { | |
| external ffi.Pointer<ffi.Void> isa; | |
| @ffi.Int() | |
| external int flags; | |
| @ffi.Int() | |
| external int reserved; | |
| external ffi.Pointer<ffi.Void> invoke; | |
| external ffi.Pointer<ObjCBlockDesc> descriptor; | |
| external ffi.Pointer<ffi.Void> target; | |
| @ffi.Int64() | |
| external int dispose_port; | |
| static ffi.Pointer<ObjCBlockImpl> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Void> isa, | |
| required int flags, | |
| required int reserved, | |
| required ffi.Pointer<ffi.Void> invoke, | |
| required ffi.Pointer<ObjCBlockDesc> descriptor, | |
| required ffi.Pointer<ffi.Void> target, | |
| required int dispose_port, | |
| }) => $allocator<ObjCBlockImpl>() | |
| ..ref.isa = isa | |
| ..ref.flags = flags | |
| ..ref.reserved = reserved | |
| ..ref.invoke = invoke | |
| ..ref.descriptor = descriptor | |
| ..ref.target = target | |
| ..ref.dispose_port = dispose_port; | |
| } | |
| final class ObjCObjectImpl extends ffi.Opaque {} | |
| final class Version extends ffi.Struct { | |
| @ffi.Int() | |
| external int major; | |
| @ffi.Int() | |
| external int minor; | |
| @ffi.Int() | |
| external int patch; | |
| static ffi.Pointer<Version> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int major, | |
| required int minor, | |
| required int patch, | |
| }) => $allocator<Version>() | |
| ..ref.major = major | |
| ..ref.minor = minor | |
| ..ref.patch = patch; | |
| } |