blob: bd87e4daa63f222f5fef24704bf85cf66e97df99 [file]
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint, unused_import
import 'dart:ffi' as ffi;
import 'package:objective_c/objective_c.dart' as objc;
import 'package:ffi/ffi.dart' as pkg_ffi;
sealed class CoffeeOptions {
static const CoffeeOptionsNone = 0;
static const CoffeeOptionsMilk = 1;
static const CoffeeOptionsSugar = 2;
static const CoffeeOptionsIced = 4;
}
/// EnumTestInterface
extension type EnumTestInterface._(objc.ObjCObject object$)
implements objc.ObjCObject, objc.NSObject {
/// Constructs a [EnumTestInterface] that points to the same underlying object as [other].
EnumTestInterface.as(objc.ObjCObject other) : object$ = other {
assert(isA(object$));
}
/// Constructs a [EnumTestInterface] that wraps the given raw object pointer.
EnumTestInterface.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 [EnumTestInterface].
static bool isA(objc.ObjCObject? obj) => obj == null
? false
: _objc_msgSend_19nvye5(
obj.ref.pointer,
_sel_isKindOfClass_,
_class_EnumTestInterface,
);
/// alloc
static EnumTestInterface alloc() {
final $ret = _objc_msgSend_151sglz(_class_EnumTestInterface, _sel_alloc);
return EnumTestInterface.fromPointer($ret, retain: false, release: true);
}
/// allocWithZone:
static EnumTestInterface allocWithZone(ffi.Pointer<objc.NSZone> zone) {
final $ret = _objc_msgSend_1cwp428(
_class_EnumTestInterface,
_sel_allocWithZone_,
zone,
);
return EnumTestInterface.fromPointer($ret, retain: false, release: true);
}
/// new
static EnumTestInterface new$() {
final $ret = _objc_msgSend_151sglz(_class_EnumTestInterface, _sel_new);
return EnumTestInterface.fromPointer($ret, retain: false, release: true);
}
/// useImportedNSEnum:
static int useImportedNSEnum(objc.NSQualityOfService x) {
return _objc_msgSend_1y89lso(
_class_EnumTestInterface,
_sel_useImportedNSEnum_,
x.value,
);
}
/// useImportedNSOptions:
static int useImportedNSOptions(int x) {
return _objc_msgSend_1cxnp8y(
_class_EnumTestInterface,
_sel_useImportedNSOptions_,
x,
);
}
/// Returns a new instance of EnumTestInterface constructed with the default `new` method.
EnumTestInterface() : this.as(new$().object$);
}
extension EnumTestInterface$Methods on EnumTestInterface {
/// init
EnumTestInterface init() {
objc.checkOsVersionInternal(
'EnumTestInterface.init',
iOS: (false, (2, 0, 0)),
macOS: (false, (10, 0, 0)),
);
final $ret = _objc_msgSend_151sglz(
object$.ref.retainAndReturnPointer(),
_sel_init,
);
return EnumTestInterface.fromPointer($ret, retain: false, release: true);
}
}
enum Fruit {
FruitApple(0),
FruitBanana(1),
FruitOrange(2),
FruitPear(3);
final int value;
const Fruit(this.value);
static Fruit fromValue(int value) => switch (value) {
0 => FruitApple,
1 => FruitBanana,
2 => FruitOrange,
3 => FruitPear,
_ => throw ArgumentError('Unknown value for Fruit: $value'),
};
}
const int SOME_MACRO = 123;
const int UnnamedEnumValue = 0;
late final _class_EnumTestInterface = objc.getClass("EnumTestInterface");
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_1cxnp8y = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Int32 Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.UnsignedLong,
)
>
>()
.asFunction<
int Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
int,
)
>();
final _objc_msgSend_1y89lso = objc.msgSendPointer
.cast<
ffi.NativeFunction<
ffi.Int32 Function(
ffi.Pointer<objc.ObjCObjectImpl>,
ffi.Pointer<objc.ObjCSelector>,
ffi.Long,
)
>
>()
.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_init = objc.registerName("init");
late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:");
late final _sel_new = objc.registerName("new");
late final _sel_useImportedNSEnum_ = objc.registerName("useImportedNSEnum:");
late final _sel_useImportedNSOptions_ = objc.registerName(
"useImportedNSOptions:",
);
typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>;
typedef Dartinstancetype = objc.ObjCObject;