-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.dart
115 lines (96 loc) · 3.32 KB
/
example.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Autogenerated by jnigen. DO NOT EDIT!
// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
// ignore_for_file: doc_directive_unknown
// ignore_for_file: file_names
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: only_throw_errors
// ignore_for_file: overridden_fields
// ignore_for_file: prefer_double_quotes
// ignore_for_file: unnecessary_cast
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: unused_element
// ignore_for_file: unused_field
// ignore_for_file: unused_import
// ignore_for_file: unused_local_variable
// ignore_for_file: unused_shown_name
// ignore_for_file: use_super_parameters
import 'dart:ffi' as ffi;
import 'dart:isolate' show ReceivePort;
import 'package:jni/internal_helpers_for_jnigen.dart';
import 'package:jni/jni.dart' as jni;
/// from: dev.dart.Example
class Example extends jni.JObject {
@override
late final jni.JObjType<Example> $type = type;
Example.fromReference(
jni.JReference reference,
) : super.fromReference(reference);
static final _class = jni.JClass.forName(r'dev/dart/Example');
/// The type which includes information such as the signature of this class.
static const type = $ExampleType();
static final _id_new0 = _class.constructorId(
r'()V',
);
static final _new0 = ProtectedJniExtensions.lookup<
ffi.NativeFunction<
jni.JniResult Function(
ffi.Pointer<ffi.Void>,
jni.JMethodIDPtr,
)>>('globalEnv_NewObject')
.asFunction<
jni.JniResult Function(
ffi.Pointer<ffi.Void>,
jni.JMethodIDPtr,
)>();
/// from: public void <init>()
/// The returned object must be released after use, by calling the [release] method.
factory Example() {
return Example.fromReference(
_new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr)
.reference);
}
static final _id_sum = _class.staticMethodId(
r'sum',
r'(II)I',
);
static final _sum = ProtectedJniExtensions.lookup<
ffi.NativeFunction<
jni.JniResult Function(ffi.Pointer<ffi.Void>,
jni.JMethodIDPtr, ffi.VarArgs<($Int32, $Int32)>)>>(
'globalEnv_CallStaticIntMethod')
.asFunction<
jni.JniResult Function(
ffi.Pointer<ffi.Void>, jni.JMethodIDPtr, int, int)>();
/// from: static public int sum(int a, int b)
static int sum(
int a,
int b,
) {
return _sum(_class.reference.pointer, _id_sum as jni.JMethodIDPtr, a, b)
.integer;
}
}
final class $ExampleType extends jni.JObjType<Example> {
const $ExampleType();
@override
String get signature => r'Ldev/dart/Example;';
@override
Example fromReference(jni.JReference reference) =>
Example.fromReference(reference);
@override
jni.JObjType get superType => const jni.JObjectType();
@override
final superCount = 1;
@override
int get hashCode => ($ExampleType).hashCode;
@override
bool operator ==(Object other) {
return other.runtimeType == ($ExampleType) && other is $ExampleType;
}
}