-
Notifications
You must be signed in to change notification settings - Fork 309
/
Copy pathbridge_generated.dart
642 lines (523 loc) · 21.1 KB
/
bridge_generated.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'dart:ffi' as ffi;
abstract class FlutterRustBridgeExample extends FlutterRustBridgeBase<FlutterRustBridgeExampleWire> {
factory FlutterRustBridgeExample(ffi.DynamicLibrary dylib) =>
FlutterRustBridgeExampleImpl.raw(FlutterRustBridgeExampleWire(dylib));
FlutterRustBridgeExample.raw(FlutterRustBridgeExampleWire inner) : super(inner);
Future<Uint8List> drawMandelbrot(
{required Size imageSize,
required Point zoomPoint,
required double scale,
required int numThreads,
dynamic hint});
Future<String> passingComplexStructs({required TreeNode root, dynamic hint});
Future<int> offTopicMemoryTestInputArray({required Uint8List input, dynamic hint});
Future<Uint8List> offTopicMemoryTestOutputZeroCopyBuffer({required int len, dynamic hint});
Future<Uint8List> offTopicMemoryTestOutputVecU8({required int len, dynamic hint});
Future<int> offTopicMemoryTestInputVecOfObject({required List<Size> input, dynamic hint});
Future<List<Size>> offTopicMemoryTestOutputVecOfObject({required int len, dynamic hint});
Future<int> offTopicMemoryTestInputComplexStruct({required TreeNode input, dynamic hint});
Future<TreeNode> offTopicMemoryTestOutputComplexStruct({required int len, dynamic hint});
Future<int> offTopicDeliberatelyReturnError({dynamic hint});
Future<int> offTopicDeliberatelyPanic({dynamic hint});
}
class Size {
final int width;
final int height;
Size({
required this.width,
required this.height,
});
}
class Point {
final double x;
final double y;
Point({
required this.x,
required this.y,
});
}
class TreeNode {
final String name;
final List<TreeNode> children;
TreeNode({
required this.name,
required this.children,
});
}
// ------------------------- Implementation Details -------------------------
/// Implementations for FlutterRustBridgeExample. Prefer using FlutterRustBridgeExample if possible; but this class allows more
/// flexible customizations (such as subclassing to create an initializer, a logger, or
/// a timer).
class FlutterRustBridgeExampleImpl extends FlutterRustBridgeExample {
FlutterRustBridgeExampleImpl.raw(FlutterRustBridgeExampleWire inner) : super.raw(inner);
Future<Uint8List> drawMandelbrot(
{required Size imageSize,
required Point zoomPoint,
required double scale,
required int numThreads,
dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'draw_mandelbrot',
callFfi: (port) => inner.wire_draw_mandelbrot(port, _api2wire_box_autoadd_size(imageSize),
_api2wire_box_autoadd_point(zoomPoint), _api2wire_f64(scale), _api2wire_i32(numThreads)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
hint: hint));
Future<String> passingComplexStructs({required TreeNode root, dynamic hint}) => executeNormal(FlutterRustBridgeTask(
debugName: 'passing_complex_structs',
callFfi: (port) => inner.wire_passing_complex_structs(port, _api2wire_box_autoadd_tree_node(root)),
parseSuccessData: _wire2api_String,
hint: hint));
Future<int> offTopicMemoryTestInputArray({required Uint8List input, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_input_array',
callFfi: (port) => inner.wire_off_topic_memory_test_input_array(port, _api2wire_uint_8_list(input)),
parseSuccessData: _wire2api_i32,
hint: hint));
Future<Uint8List> offTopicMemoryTestOutputZeroCopyBuffer({required int len, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_output_zero_copy_buffer',
callFfi: (port) => inner.wire_off_topic_memory_test_output_zero_copy_buffer(port, _api2wire_i32(len)),
parseSuccessData: _wire2api_ZeroCopyBuffer_Uint8List,
hint: hint));
Future<Uint8List> offTopicMemoryTestOutputVecU8({required int len, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_output_vec_u8',
callFfi: (port) => inner.wire_off_topic_memory_test_output_vec_u8(port, _api2wire_i32(len)),
parseSuccessData: _wire2api_uint_8_list,
hint: hint));
Future<int> offTopicMemoryTestInputVecOfObject({required List<Size> input, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_input_vec_of_object',
callFfi: (port) => inner.wire_off_topic_memory_test_input_vec_of_object(port, _api2wire_list_size(input)),
parseSuccessData: _wire2api_i32,
hint: hint));
Future<List<Size>> offTopicMemoryTestOutputVecOfObject({required int len, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_output_vec_of_object',
callFfi: (port) => inner.wire_off_topic_memory_test_output_vec_of_object(port, _api2wire_i32(len)),
parseSuccessData: _wire2api_list_size,
hint: hint));
Future<int> offTopicMemoryTestInputComplexStruct({required TreeNode input, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_input_complex_struct',
callFfi: (port) =>
inner.wire_off_topic_memory_test_input_complex_struct(port, _api2wire_box_autoadd_tree_node(input)),
parseSuccessData: _wire2api_i32,
hint: hint));
Future<TreeNode> offTopicMemoryTestOutputComplexStruct({required int len, dynamic hint}) =>
executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_memory_test_output_complex_struct',
callFfi: (port) => inner.wire_off_topic_memory_test_output_complex_struct(port, _api2wire_i32(len)),
parseSuccessData: _wire2api_tree_node,
hint: hint));
Future<int> offTopicDeliberatelyReturnError({dynamic hint}) => executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_deliberately_return_error',
callFfi: (port) => inner.wire_off_topic_deliberately_return_error(
port,
),
parseSuccessData: _wire2api_i32,
hint: hint));
Future<int> offTopicDeliberatelyPanic({dynamic hint}) => executeNormal(FlutterRustBridgeTask(
debugName: 'off_topic_deliberately_panic',
callFfi: (port) => inner.wire_off_topic_deliberately_panic(
port,
),
parseSuccessData: _wire2api_i32,
hint: hint));
// Section: api2wire
ffi.Pointer<wire_Size> _api2wire_box_autoadd_size(Size raw) {
final ptr = inner.new_box_autoadd_size();
_api_fill_to_wire_size(raw, ptr.ref);
return ptr;
}
int _api2wire_i32(int raw) {
return raw;
}
ffi.Pointer<wire_Point> _api2wire_box_autoadd_point(Point raw) {
final ptr = inner.new_box_autoadd_point();
_api_fill_to_wire_point(raw, ptr.ref);
return ptr;
}
double _api2wire_f64(double raw) {
return raw;
}
ffi.Pointer<wire_uint_8_list> _api2wire_ZeroCopyBuffer_Uint8List(Uint8List raw) {
return _api2wire_uint_8_list(raw);
}
ffi.Pointer<wire_uint_8_list> _api2wire_uint_8_list(Uint8List raw) {
final ans = inner.new_uint_8_list(raw.length);
ans.ref.ptr.asTypedList(raw.length).setAll(0, raw);
return ans;
}
int _api2wire_u8(int raw) {
return raw;
}
ffi.Pointer<wire_TreeNode> _api2wire_box_autoadd_tree_node(TreeNode raw) {
final ptr = inner.new_box_autoadd_tree_node();
_api_fill_to_wire_tree_node(raw, ptr.ref);
return ptr;
}
ffi.Pointer<wire_uint_8_list> _api2wire_String(String raw) {
return _api2wire_uint_8_list(utf8.encoder.convert(raw));
}
ffi.Pointer<wire_list_tree_node> _api2wire_list_tree_node(List<TreeNode> raw) {
final ans = inner.new_list_tree_node(raw.length);
for (var i = 0; i < raw.length; ++i) {
_api_fill_to_wire_tree_node(raw[i], ans.ref.ptr[i]);
}
return ans;
}
ffi.Pointer<wire_list_size> _api2wire_list_size(List<Size> raw) {
final ans = inner.new_list_size(raw.length);
for (var i = 0; i < raw.length; ++i) {
_api_fill_to_wire_size(raw[i], ans.ref.ptr[i]);
}
return ans;
}
// Section: api_fill_to_wire
void _api_fill_to_wire_box_autoadd_size(Size apiObj, ffi.Pointer<wire_Size> wireObj) {
_api_fill_to_wire_size(apiObj, wireObj.ref);
}
void _api_fill_to_wire_size(Size apiObj, wire_Size wireObj) {
wireObj.width = _api2wire_i32(apiObj.width);
wireObj.height = _api2wire_i32(apiObj.height);
}
void _api_fill_to_wire_box_autoadd_point(Point apiObj, ffi.Pointer<wire_Point> wireObj) {
_api_fill_to_wire_point(apiObj, wireObj.ref);
}
void _api_fill_to_wire_point(Point apiObj, wire_Point wireObj) {
wireObj.x = _api2wire_f64(apiObj.x);
wireObj.y = _api2wire_f64(apiObj.y);
}
void _api_fill_to_wire_box_autoadd_tree_node(TreeNode apiObj, ffi.Pointer<wire_TreeNode> wireObj) {
_api_fill_to_wire_tree_node(apiObj, wireObj.ref);
}
void _api_fill_to_wire_tree_node(TreeNode apiObj, wire_TreeNode wireObj) {
wireObj.name = _api2wire_String(apiObj.name);
wireObj.children = _api2wire_list_tree_node(apiObj.children);
}
}
// Section: wire2api
Size _wire2api_box_autoadd_size(dynamic raw) {
return _wire2api_size(raw);
}
Size _wire2api_size(dynamic raw) {
final arr = raw as List<dynamic>;
if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return Size(
width: _wire2api_i32(arr[0]),
height: _wire2api_i32(arr[1]),
);
}
int _wire2api_i32(dynamic raw) {
return raw as int;
}
Point _wire2api_box_autoadd_point(dynamic raw) {
return _wire2api_point(raw);
}
Point _wire2api_point(dynamic raw) {
final arr = raw as List<dynamic>;
if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return Point(
x: _wire2api_f64(arr[0]),
y: _wire2api_f64(arr[1]),
);
}
double _wire2api_f64(dynamic raw) {
return raw as double;
}
Uint8List _wire2api_ZeroCopyBuffer_Uint8List(dynamic raw) {
return raw as Uint8List;
}
Uint8List _wire2api_uint_8_list(dynamic raw) {
return raw as Uint8List;
}
int _wire2api_u8(dynamic raw) {
return raw as int;
}
TreeNode _wire2api_box_autoadd_tree_node(dynamic raw) {
return _wire2api_tree_node(raw);
}
TreeNode _wire2api_tree_node(dynamic raw) {
final arr = raw as List<dynamic>;
if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return TreeNode(
name: _wire2api_String(arr[0]),
children: _wire2api_list_tree_node(arr[1]),
);
}
String _wire2api_String(dynamic raw) {
return raw as String;
}
List<TreeNode> _wire2api_list_tree_node(dynamic raw) {
return (raw as List<dynamic>).map(_wire2api_tree_node).toList();
}
List<Size> _wire2api_list_size(dynamic raw) {
return (raw as List<dynamic>).map(_wire2api_size).toList();
}
// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
/// generated by flutter_rust_bridge
class FlutterRustBridgeExampleWire implements FlutterRustBridgeWireBase {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) _lookup;
/// The symbols are looked up in [dynamicLibrary].
FlutterRustBridgeExampleWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
FlutterRustBridgeExampleWire.fromLookup(ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) lookup)
: _lookup = lookup;
void wire_draw_mandelbrot(
int port,
ffi.Pointer<wire_Size> image_size,
ffi.Pointer<wire_Point> zoom_point,
double scale,
int num_threads,
) {
return _wire_draw_mandelbrot(
port,
image_size,
zoom_point,
scale,
num_threads,
);
}
late final _wire_draw_mandelbrotPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.Pointer<wire_Size>, ffi.Pointer<wire_Point>, ffi.Double,
ffi.Int32)>>('wire_draw_mandelbrot');
late final _wire_draw_mandelbrot = _wire_draw_mandelbrotPtr
.asFunction<void Function(int, ffi.Pointer<wire_Size>, ffi.Pointer<wire_Point>, double, int)>();
void wire_passing_complex_structs(
int port,
ffi.Pointer<wire_TreeNode> root,
) {
return _wire_passing_complex_structs(
port,
root,
);
}
late final _wire_passing_complex_structsPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_TreeNode>)>>(
'wire_passing_complex_structs');
late final _wire_passing_complex_structs =
_wire_passing_complex_structsPtr.asFunction<void Function(int, ffi.Pointer<wire_TreeNode>)>();
void wire_off_topic_memory_test_input_array(
int port,
ffi.Pointer<wire_uint_8_list> input,
) {
return _wire_off_topic_memory_test_input_array(
port,
input,
);
}
late final _wire_off_topic_memory_test_input_arrayPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_uint_8_list>)>>(
'wire_off_topic_memory_test_input_array');
late final _wire_off_topic_memory_test_input_array =
_wire_off_topic_memory_test_input_arrayPtr.asFunction<void Function(int, ffi.Pointer<wire_uint_8_list>)>();
void wire_off_topic_memory_test_output_zero_copy_buffer(
int port,
int len,
) {
return _wire_off_topic_memory_test_output_zero_copy_buffer(
port,
len,
);
}
late final _wire_off_topic_memory_test_output_zero_copy_bufferPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Int32)>>(
'wire_off_topic_memory_test_output_zero_copy_buffer');
late final _wire_off_topic_memory_test_output_zero_copy_buffer =
_wire_off_topic_memory_test_output_zero_copy_bufferPtr.asFunction<void Function(int, int)>();
void wire_off_topic_memory_test_output_vec_u8(
int port,
int len,
) {
return _wire_off_topic_memory_test_output_vec_u8(
port,
len,
);
}
late final _wire_off_topic_memory_test_output_vec_u8Ptr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Int32)>>('wire_off_topic_memory_test_output_vec_u8');
late final _wire_off_topic_memory_test_output_vec_u8 =
_wire_off_topic_memory_test_output_vec_u8Ptr.asFunction<void Function(int, int)>();
void wire_off_topic_memory_test_input_vec_of_object(
int port,
ffi.Pointer<wire_list_size> input,
) {
return _wire_off_topic_memory_test_input_vec_of_object(
port,
input,
);
}
late final _wire_off_topic_memory_test_input_vec_of_objectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_list_size>)>>(
'wire_off_topic_memory_test_input_vec_of_object');
late final _wire_off_topic_memory_test_input_vec_of_object =
_wire_off_topic_memory_test_input_vec_of_objectPtr.asFunction<void Function(int, ffi.Pointer<wire_list_size>)>();
void wire_off_topic_memory_test_output_vec_of_object(
int port,
int len,
) {
return _wire_off_topic_memory_test_output_vec_of_object(
port,
len,
);
}
late final _wire_off_topic_memory_test_output_vec_of_objectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Int32)>>(
'wire_off_topic_memory_test_output_vec_of_object');
late final _wire_off_topic_memory_test_output_vec_of_object =
_wire_off_topic_memory_test_output_vec_of_objectPtr.asFunction<void Function(int, int)>();
void wire_off_topic_memory_test_input_complex_struct(
int port,
ffi.Pointer<wire_TreeNode> input,
) {
return _wire_off_topic_memory_test_input_complex_struct(
port,
input,
);
}
late final _wire_off_topic_memory_test_input_complex_structPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_TreeNode>)>>(
'wire_off_topic_memory_test_input_complex_struct');
late final _wire_off_topic_memory_test_input_complex_struct =
_wire_off_topic_memory_test_input_complex_structPtr.asFunction<void Function(int, ffi.Pointer<wire_TreeNode>)>();
void wire_off_topic_memory_test_output_complex_struct(
int port,
int len,
) {
return _wire_off_topic_memory_test_output_complex_struct(
port,
len,
);
}
late final _wire_off_topic_memory_test_output_complex_structPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Int32)>>(
'wire_off_topic_memory_test_output_complex_struct');
late final _wire_off_topic_memory_test_output_complex_struct =
_wire_off_topic_memory_test_output_complex_structPtr.asFunction<void Function(int, int)>();
void wire_off_topic_deliberately_return_error(
int port,
) {
return _wire_off_topic_deliberately_return_error(
port,
);
}
late final _wire_off_topic_deliberately_return_errorPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('wire_off_topic_deliberately_return_error');
late final _wire_off_topic_deliberately_return_error =
_wire_off_topic_deliberately_return_errorPtr.asFunction<void Function(int)>();
void wire_off_topic_deliberately_panic(
int port,
) {
return _wire_off_topic_deliberately_panic(
port,
);
}
late final _wire_off_topic_deliberately_panicPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('wire_off_topic_deliberately_panic');
late final _wire_off_topic_deliberately_panic =
_wire_off_topic_deliberately_panicPtr.asFunction<void Function(int)>();
ffi.Pointer<wire_Size> new_box_autoadd_size() {
return _new_box_autoadd_size();
}
late final _new_box_autoadd_sizePtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_Size> Function()>>('new_box_autoadd_size');
late final _new_box_autoadd_size = _new_box_autoadd_sizePtr.asFunction<ffi.Pointer<wire_Size> Function()>();
ffi.Pointer<wire_Point> new_box_autoadd_point() {
return _new_box_autoadd_point();
}
late final _new_box_autoadd_pointPtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_Point> Function()>>('new_box_autoadd_point');
late final _new_box_autoadd_point = _new_box_autoadd_pointPtr.asFunction<ffi.Pointer<wire_Point> Function()>();
ffi.Pointer<wire_uint_8_list> new_uint_8_list(
int len,
) {
return _new_uint_8_list(
len,
);
}
late final _new_uint_8_listPtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_uint_8_list> Function(ffi.Int32)>>('new_uint_8_list');
late final _new_uint_8_list = _new_uint_8_listPtr.asFunction<ffi.Pointer<wire_uint_8_list> Function(int)>();
ffi.Pointer<wire_TreeNode> new_box_autoadd_tree_node() {
return _new_box_autoadd_tree_node();
}
late final _new_box_autoadd_tree_nodePtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_TreeNode> Function()>>('new_box_autoadd_tree_node');
late final _new_box_autoadd_tree_node =
_new_box_autoadd_tree_nodePtr.asFunction<ffi.Pointer<wire_TreeNode> Function()>();
ffi.Pointer<wire_list_tree_node> new_list_tree_node(
int len,
) {
return _new_list_tree_node(
len,
);
}
late final _new_list_tree_nodePtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_list_tree_node> Function(ffi.Int32)>>('new_list_tree_node');
late final _new_list_tree_node = _new_list_tree_nodePtr.asFunction<ffi.Pointer<wire_list_tree_node> Function(int)>();
ffi.Pointer<wire_list_size> new_list_size(
int len,
) {
return _new_list_size(
len,
);
}
late final _new_list_sizePtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_list_size> Function(ffi.Int32)>>('new_list_size');
late final _new_list_size = _new_list_sizePtr.asFunction<ffi.Pointer<wire_list_size> Function(int)>();
void store_dart_post_cobject(
DartPostCObjectFnType ptr,
) {
return _store_dart_post_cobject(
ptr,
);
}
late final _store_dart_post_cobjectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(DartPostCObjectFnType)>>('store_dart_post_cobject');
late final _store_dart_post_cobject = _store_dart_post_cobjectPtr.asFunction<void Function(DartPostCObjectFnType)>();
}
class wire_Size extends ffi.Struct {
@ffi.Int32()
external int width;
@ffi.Int32()
external int height;
}
class wire_Point extends ffi.Struct {
@ffi.Double()
external double x;
@ffi.Double()
external double y;
}
class wire_uint_8_list extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
class wire_list_tree_node extends ffi.Struct {
external ffi.Pointer<wire_TreeNode> ptr;
@ffi.Int32()
external int len;
}
class wire_TreeNode extends ffi.Struct {
external ffi.Pointer<wire_uint_8_list> name;
external ffi.Pointer<wire_list_tree_node> children;
}
class wire_list_size extends ffi.Struct {
external ffi.Pointer<wire_Size> ptr;
@ffi.Int32()
external int len;
}
typedef DartPostCObjectFnType = ffi.Pointer<ffi.NativeFunction<ffi.Uint8 Function(DartPort, ffi.Pointer<ffi.Void>)>>;
typedef DartPort = ffi.Int64;