blob: f508dacda525f227c3c6559e1f80d4d8a9feb589 [file]
// Autogenerated by jnigen. DO NOT EDIT!
// ignore_for_file: annotate_overrides
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
// ignore_for_file: file_names
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: overridden_fields
// ignore_for_file: unnecessary_cast
// ignore_for_file: unused_element
// ignore_for_file: unused_field
// ignore_for_file: unused_import
// ignore_for_file: unused_shown_name
import "dart:isolate" show ReceivePort;
import "dart:ffi" as ffi;
import "package:jni/internal_helpers_for_jnigen.dart";
import "package:jni/jni.dart" as jni;
// Auto-generated initialization code.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String sym) jniLookup =
ProtectedJniExtensions.initGeneratedLibrary("kotlin_plugin_bindings");
/// from: Example
class Example extends jni.JObject {
late final jni.JObjType? _$type;
@override
jni.JObjType get $type => _$type ??= type;
Example.fromRef(
jni.JObjectPtr ref,
) : super.fromRef(ref);
/// The type which includes information such as the signature of this class.
static const type = $ExampleType();
static final _ctor =
jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example__ctor")
.asFunction<jni.JniResult Function()>();
/// from: public void <init>()
/// The returned object must be deleted after use, by calling the `delete` method.
Example() : super.fromRef(_ctor().object);
static final _thinkBeforeAnswering = jniLookup<
ffi.NativeFunction<
jni.JniResult Function(ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Void>)>>("Example__thinkBeforeAnswering")
.asFunction<
jni.JniResult Function(
ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>();
/// from: public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)
/// The returned object must be deleted after use, by calling the `delete` method.
Future<jni.JString> thinkBeforeAnswering() async {
final $p = ReceivePort();
final $c = jni.JObject.fromRef(jni.Jni.newPortContinuation($p));
_thinkBeforeAnswering(reference, $c.reference).object;
final $o = jni.JObjectPtr.fromAddress(await $p.first);
final $k = const jni.JStringType().getClass().reference;
if (jni.Jni.env.IsInstanceOf($o, $k) == 0) {
throw "Failed";
}
return const jni.JStringType().fromRef($o);
}
}
class $ExampleType extends jni.JObjType<Example> {
const $ExampleType();
@override
String get signature => r"LExample;";
@override
Example fromRef(jni.JObjectPtr ref) => Example.fromRef(ref);
}
extension $ExampleArray on jni.JArray<Example> {
Example operator [](int index) {
return (elementType as $ExampleType)
.fromRef(elementAt(index, jni.JniCallType.objectType).object);
}
void operator []=(int index, Example value) {
(this as jni.JArray<jni.JObject>)[index] = value;
}
}