maa-framework-sys 5.10.1

Low-level Rust bindings for MaaFramework
Documentation
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
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
/* automatically generated by rust-bindgen 0.72.1 */

pub const MaaNullSize: i32 = -1;
pub const MaaAdbScreencapMethod_EncodeToFileAndPull: u32 = 1;
pub const MaaAdbScreencapMethod_Encode: u32 = 2;
pub const MaaAdbScreencapMethod_RawWithGzip: u32 = 4;
pub const MaaAdbScreencapMethod_RawByNetcat: u32 = 8;
pub const MaaAdbScreencapMethod_MinicapDirect: u32 = 16;
pub const MaaAdbScreencapMethod_MinicapStream: u32 = 32;
pub const MaaAdbScreencapMethod_EmulatorExtras: u32 = 64;
pub const MaaAdbScreencapMethod_None: u32 = 0;
pub const MaaAdbScreencapMethod_All: i32 = -1;
pub const MaaAdbScreencapMethod_Default: i32 = -57;
pub const MaaAdbInputMethod_AdbShell: u32 = 1;
pub const MaaAdbInputMethod_MinitouchAndAdbKey: u32 = 2;
pub const MaaAdbInputMethod_Maatouch: u32 = 4;
pub const MaaAdbInputMethod_EmulatorExtras: u32 = 8;
pub const MaaAdbInputMethod_None: u32 = 0;
pub const MaaAdbInputMethod_All: i32 = -1;
pub const MaaAdbInputMethod_Default: i32 = -9;
pub const MaaWin32ScreencapMethod_None: u32 = 0;
pub const MaaWin32ScreencapMethod_GDI: u32 = 1;
pub const MaaWin32ScreencapMethod_FramePool: u32 = 2;
pub const MaaWin32ScreencapMethod_DXGI_DesktopDup: u32 = 4;
pub const MaaWin32ScreencapMethod_DXGI_DesktopDup_Window: u32 = 8;
pub const MaaWin32ScreencapMethod_PrintWindow: u32 = 16;
pub const MaaWin32ScreencapMethod_ScreenDC: u32 = 32;
pub const MaaWin32ScreencapMethod_All: i32 = -1;
pub const MaaWin32ScreencapMethod_Foreground: u32 = 40;
pub const MaaWin32ScreencapMethod_Background: u32 = 18;
pub const MaaWin32InputMethod_None: u32 = 0;
pub const MaaWin32InputMethod_Seize: u32 = 1;
pub const MaaWin32InputMethod_SendMessage: u32 = 2;
pub const MaaWin32InputMethod_PostMessage: u32 = 4;
pub const MaaWin32InputMethod_LegacyEvent: u32 = 8;
pub const MaaWin32InputMethod_PostThreadMessage: u32 = 16;
pub const MaaWin32InputMethod_SendMessageWithCursorPos: u32 = 32;
pub const MaaWin32InputMethod_PostMessageWithCursorPos: u32 = 64;
pub const MaaWin32InputMethod_SendMessageWithWindowPos: u32 = 128;
pub const MaaWin32InputMethod_PostMessageWithWindowPos: u32 = 256;
pub const MaaMacOSScreencapMethod_None: u32 = 0;
pub const MaaMacOSScreencapMethod_ScreenCaptureKit: u32 = 1;
pub const MaaMacOSInputMethod_None: u32 = 0;
pub const MaaMacOSInputMethod_GlobalEvent: u32 = 1;
pub const MaaMacOSInputMethod_PostToPid: u32 = 2;
pub const MaaGamepadType_Xbox360: u32 = 0;
pub const MaaGamepadType_DualShock4: u32 = 1;
pub const MaaGamepadButton_A: u32 = 4096;
pub const MaaGamepadButton_B: u32 = 8192;
pub const MaaGamepadButton_X: u32 = 16384;
pub const MaaGamepadButton_Y: u32 = 32768;
pub const MaaGamepadButton_LB: u32 = 256;
pub const MaaGamepadButton_RB: u32 = 512;
pub const MaaGamepadButton_LEFT_THUMB: u32 = 64;
pub const MaaGamepadButton_RIGHT_THUMB: u32 = 128;
pub const MaaGamepadButton_START: u32 = 16;
pub const MaaGamepadButton_BACK: u32 = 32;
pub const MaaGamepadButton_GUIDE: u32 = 1024;
pub const MaaGamepadButton_DPAD_UP: u32 = 1;
pub const MaaGamepadButton_DPAD_DOWN: u32 = 2;
pub const MaaGamepadButton_DPAD_LEFT: u32 = 4;
pub const MaaGamepadButton_DPAD_RIGHT: u32 = 8;
pub const MaaGamepadButton_CROSS: u32 = 4096;
pub const MaaGamepadButton_CIRCLE: u32 = 8192;
pub const MaaGamepadButton_SQUARE: u32 = 16384;
pub const MaaGamepadButton_TRIANGLE: u32 = 32768;
pub const MaaGamepadButton_L1: u32 = 256;
pub const MaaGamepadButton_R1: u32 = 512;
pub const MaaGamepadButton_L3: u32 = 64;
pub const MaaGamepadButton_R3: u32 = 128;
pub const MaaGamepadButton_OPTIONS: u32 = 16;
pub const MaaGamepadButton_SHARE: u32 = 32;
pub const MaaGamepadButton_PS: u32 = 65536;
pub const MaaGamepadButton_TOUCHPAD: u32 = 131072;
pub const MaaGamepadTouch_LeftStick: u32 = 0;
pub const MaaGamepadTouch_RightStick: u32 = 1;
pub const MaaGamepadTouch_LeftTrigger: u32 = 2;
pub const MaaGamepadTouch_RightTrigger: u32 = 3;
pub const MaaControllerFeature_None: u32 = 0;
pub const MaaControllerFeature_UseMouseDownAndUpInsteadOfClick: u32 = 1;
pub const MaaControllerFeature_UseKeyboardDownAndUpInsteadOfClick: u32 = 2;
pub const MaaControllerFeature_NoScalingTouchPoints: u32 = 4;
pub type MaaBool = u8;
pub type MaaSize = u64;
pub type MaaId = i64;
pub type MaaCtrlId = MaaId;
pub type MaaResId = MaaId;
pub type MaaTaskId = MaaId;
pub type MaaRecoId = MaaId;
pub type MaaActId = MaaId;
pub type MaaNodeId = MaaId;
pub type MaaWfId = MaaId;
pub type MaaSinkId = MaaId;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaStringBuffer {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaImageBuffer {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaStringListBuffer {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaImageListBuffer {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaResource {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaController {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaTasker {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaContext {
    _unused: [u8; 0],
}
pub type MaaStatus = i32;
pub const MaaStatusEnum_MaaStatus_Invalid: MaaStatusEnum = 0;
pub const MaaStatusEnum_MaaStatus_Pending: MaaStatusEnum = 1000;
pub const MaaStatusEnum_MaaStatus_Running: MaaStatusEnum = 2000;
pub const MaaStatusEnum_MaaStatus_Succeeded: MaaStatusEnum = 3000;
pub const MaaStatusEnum_MaaStatus_Failed: MaaStatusEnum = 4000;
pub type MaaStatusEnum = ::std::os::raw::c_uint;
pub type MaaLoggingLevel = i32;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Off: MaaLoggingLevelEnum = 0;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Fatal: MaaLoggingLevelEnum = 1;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Error: MaaLoggingLevelEnum = 2;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Warn: MaaLoggingLevelEnum = 3;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Info: MaaLoggingLevelEnum = 4;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Debug: MaaLoggingLevelEnum = 5;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_Trace: MaaLoggingLevelEnum = 6;
pub const MaaLoggingLevelEnum_MaaLoggingLevel_All: MaaLoggingLevelEnum = 7;
pub type MaaLoggingLevelEnum = ::std::os::raw::c_uint;
pub type MaaOption = i32;
pub type MaaOptionValue = *mut ::std::os::raw::c_void;
pub type MaaOptionValueSize = u64;
pub type MaaGlobalOption = MaaOption;
pub const MaaGlobalOptionEnum_MaaGlobalOption_Invalid: MaaGlobalOptionEnum = 0;
#[doc = " Log dir\n\n value: string, eg: \"C:\\\\Users\\\\Administrator\\\\Desktop\\\\log\"; val_size: string length"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_LogDir: MaaGlobalOptionEnum = 1;
#[doc = " Whether to save draw\n\n value: bool, eg: true; val_size: sizeof(bool)"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_SaveDraw: MaaGlobalOptionEnum = 2;
#[doc = " The level of log output to stdout\n\n value: MaaLoggingLevel, val_size: sizeof(MaaLoggingLevel)\n default value is MaaLoggingLevel_Error"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_StdoutLevel: MaaGlobalOptionEnum = 4;
#[doc = " Whether to debug\n\n value: bool, eg: true; val_size: sizeof(bool)"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_DebugMode: MaaGlobalOptionEnum = 6;
#[doc = " Whether to save screenshot on error\n\n value: bool, eg: true; val_size: sizeof(bool)"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_SaveOnError: MaaGlobalOptionEnum = 7;
#[doc = " Image quality for draw images\n\n value: int, eg: 85; val_size: sizeof(int)\n default value is 85, range: [0, 100]"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_DrawQuality: MaaGlobalOptionEnum = 8;
#[doc = " Recognition image cache limit\n\n value: size_t, eg: 4096; val_size: sizeof(size_t)\n default value is 4096"]
pub const MaaGlobalOptionEnum_MaaGlobalOption_RecoImageCacheLimit: MaaGlobalOptionEnum = 9;
pub type MaaGlobalOptionEnum = ::std::os::raw::c_uint;
pub type MaaResOption = MaaOption;
pub type MaaInferenceDevice = i32;
pub type MaaInferenceExecutionProvider = i32;
pub const MaaInferenceDeviceEnum_MaaInferenceDevice_CPU: MaaInferenceDeviceEnum = -2;
pub const MaaInferenceDeviceEnum_MaaInferenceDevice_Auto: MaaInferenceDeviceEnum = -1;
pub const MaaInferenceDeviceEnum_MaaInferenceDevice_0: MaaInferenceDeviceEnum = 0;
pub const MaaInferenceDeviceEnum_MaaInferenceDevice_1: MaaInferenceDeviceEnum = 1;
pub type MaaInferenceDeviceEnum = ::std::os::raw::c_int;
pub const MaaInferenceExecutionProviderEnum_MaaInferenceExecutionProvider_Auto:
    MaaInferenceExecutionProviderEnum = 0;
pub const MaaInferenceExecutionProviderEnum_MaaInferenceExecutionProvider_CPU:
    MaaInferenceExecutionProviderEnum = 1;
pub const MaaInferenceExecutionProviderEnum_MaaInferenceExecutionProvider_DirectML:
    MaaInferenceExecutionProviderEnum = 2;
pub const MaaInferenceExecutionProviderEnum_MaaInferenceExecutionProvider_CoreML:
    MaaInferenceExecutionProviderEnum = 3;
pub const MaaInferenceExecutionProviderEnum_MaaInferenceExecutionProvider_CUDA:
    MaaInferenceExecutionProviderEnum = 4;
pub type MaaInferenceExecutionProviderEnum = ::std::os::raw::c_uint;
pub const MaaResOptionEnum_MaaResOption_Invalid: MaaResOptionEnum = 0;
#[doc = " Use the specified inference device.\n Please set this option before loading the model.\n\n value: MaaInferenceDevice, eg: 0; val_size: sizeof(MaaInferenceDevice)\n default value is MaaInferenceDevice_Auto"]
pub const MaaResOptionEnum_MaaResOption_InferenceDevice: MaaResOptionEnum = 1;
#[doc = " Use the specified inference execution provider\n Please set this option before loading the model.\n\n value: MaaInferenceExecutionProvider, eg: 0; val_size: sizeof(MaaInferenceExecutionProvider)\n default value is MaaInferenceExecutionProvider_Auto"]
pub const MaaResOptionEnum_MaaResOption_InferenceExecutionProvider: MaaResOptionEnum = 2;
pub type MaaResOptionEnum = ::std::os::raw::c_uint;
pub type MaaCtrlOption = MaaOption;
pub const MaaCtrlOptionEnum_MaaCtrlOption_Invalid: MaaCtrlOptionEnum = 0;
#[doc = " Only one of long and short side can be set, and the other is automatically scaled according to the aspect ratio.\n\n value: int, eg: 1280; val_size: sizeof(int)"]
pub const MaaCtrlOptionEnum_MaaCtrlOption_ScreenshotTargetLongSide: MaaCtrlOptionEnum = 1;
#[doc = " Only one of long and short side can be set, and the other is automatically scaled according to the aspect ratio.\n\n value: int, eg: 720; val_size: sizeof(int)"]
pub const MaaCtrlOptionEnum_MaaCtrlOption_ScreenshotTargetShortSide: MaaCtrlOptionEnum = 2;
#[doc = " Screenshot use raw size without scaling.\n Please note that this option may cause incorrect coordinates on user devices with different resolutions if scaling is not performed.\n\n value: bool, eg: true; val_size: sizeof(bool)"]
pub const MaaCtrlOptionEnum_MaaCtrlOption_ScreenshotUseRawSize: MaaCtrlOptionEnum = 3;
#[doc = " Enable or disable mouse-lock-follow mode for Win32 controllers.\n This is designed for TPS/FPS games that lock the mouse to their window in the background.\n Only valid for Win32 controllers using message-based input methods.\n\n value: bool, eg: true; val_size: sizeof(bool)"]
pub const MaaCtrlOptionEnum_MaaCtrlOption_MouseLockFollow: MaaCtrlOptionEnum = 4;
#[doc = " Set the interpolation method used when resizing screenshots.\n Value corresponds to cv::InterpolationFlags:\n   INTER_NEAREST=0, INTER_LINEAR=1, INTER_CUBIC=2, INTER_AREA=3, INTER_LANCZOS4=4\n Default is INTER_AREA (3).\n\n value: int, eg: 3; val_size: sizeof(int)"]
pub const MaaCtrlOptionEnum_MaaCtrlOption_ScreenshotResizeMethod: MaaCtrlOptionEnum = 6;
#[doc = " @brief Option keys for controller instance options. See MaaControllerSetOption().\n"]
pub type MaaCtrlOptionEnum = ::std::os::raw::c_uint;
pub type MaaTaskerOption = MaaOption;
pub const MaaTaskerOptionEnum_MaaTaskerOption_Invalid: MaaTaskerOptionEnum = 0;
pub type MaaTaskerOptionEnum = ::std::os::raw::c_uint;
#[doc = " @brief Adb screencap method flags\n\n Use bitwise OR to set the methods you need.\n MaaFramework will test all provided methods and use the fastest available one.\n\n Default: All methods except RawByNetcat, MinicapDirect, MinicapStream\n\n Note: MinicapDirect and MinicapStream use lossy JPEG encoding, which may\n significantly reduce template matching accuracy. Not recommended.\n\n | Method                | Speed      | Compatibility | Encoding | Notes                             |\n |-----------------------|------------|---------------|----------|-----------------------------------|\n | EncodeToFileAndPull   | Slow       | High          | Lossless |                                   |\n | Encode                | Slow       | High          | Lossless |                                   |\n | RawWithGzip           | Medium     | High          | Lossless |                                   |\n | RawByNetcat           | Fast       | Low           | Lossless |                                   |\n | MinicapDirect         | Fast       | Low           | Lossy    |                                   |\n | MinicapStream         | Very Fast  | Low           | Lossy    |                                   |\n | EmulatorExtras        | Very Fast  | Low           | Lossless | Emulators only: MuMu 12, LDPlayer 9 |"]
pub type MaaAdbScreencapMethod = u64;
#[doc = " @brief Adb input method flags\n\n Use bitwise OR to set the methods you need.\n MaaFramework will select the first available method according to priority.\n\n Priority (high to low): EmulatorExtras > Maatouch > MinitouchAndAdbKey > AdbShell\n\n Default: All methods except EmulatorExtras\n\n | Method               | Speed | Compatibility | Notes                                 |\n |----------------------|-------|---------------|---------------------------------------|\n | AdbShell             | Slow  | High          |                                       |\n | MinitouchAndAdbKey   | Fast  | Medium        | Key press still uses AdbShell         |\n | Maatouch             | Fast  | Medium        |                                       |\n | EmulatorExtras       | Fast  | Low           | Emulators only: MuMu 12               |"]
pub type MaaAdbInputMethod = u64;
#[doc = " @brief Win32 screencap method flags\n\n Use bitwise OR to set the methods you need.\n MaaFramework will test all provided methods and use the fastest available one.\n\n No default value. Client should choose one as default.\n\n Predefined combinations:\n - Foreground: DXGI_DesktopDup_Window | ScreenDC\n - Background: FramePool | PrintWindow\n\n Different applications use different rendering methods, there is no universal solution.\n\n | Method                  | Speed     | Compatibility | Require Admin | Background Support | Notes                            |\n |-------------------------|-----------|---------------|---------------|--------------------|----------------------------------|\n | GDI                     | Fast      | Medium        | No            | No                 |                                  |\n | FramePool               | Very Fast | Medium        | No            | Yes                | Requires Windows 10 1903+        |\n | DXGI_DesktopDup         | Very Fast | Low           | No            | No                 | Desktop duplication (full screen)|\n | DXGI_DesktopDup_Window  | Very Fast | Low           | No            | No                 | Desktop duplication then crop    |\n | PrintWindow             | Medium    | Medium        | No            | Yes                |                                  |\n | ScreenDC                | Fast      | High          | No            | No                 |                                  |\n\n Note: FramePool and PrintWindow support pseudo-minimize — when the target window\n is minimized, they make it transparent and click-through, then restore it without\n activation, allowing screencap to continue without disturbing the user.\n Other screencap methods will fail when the target window is minimized."]
pub type MaaWin32ScreencapMethod = u64;
#[doc = " @brief Win32 input method\n\n No bitwise OR, select ONE method only.\n\n No default value. Client should choose one as default.\n\n Different applications process input differently, there is no universal solution.\n\n | Method                       | Compatibility | Require Admin | Seize Mouse  | Background Support | Notes |\n |------------------------------|---------------|---------------|--------------|--------------------|-------------------------------------------------------------\n | | Seize                        | High          | No            | Yes          | No                 | | | SendMessage                  |\n Medium        | Maybe         | No           | Yes                |                                                             | |\n PostMessage                  | Medium        | Maybe         | No           | Yes                | | | LegacyEvent                  | Low\n | No            | Yes          | No                 |                                                             | | PostThreadMessage\n | Low           | Maybe         | No           | Yes                |                                                             | |\n SendMessageWithCursorPos     | Medium        | Maybe         | Briefly      | Yes                | Moves cursor to target position, then\n restores              | | PostMessageWithCursorPos     | Medium        | Maybe         | Briefly      | Yes                | Moves cursor\n to target position, then restores              | | SendMessageWithWindowPos     | Medium        | Maybe         | No           | Yes |\n Moves window to align target with cursor, then restores     | | PostMessageWithWindowPos     | Medium        | Maybe         | No | Yes |\n Moves window to align target with cursor, then restores     |\n\n Note:\n - Admin rights mainly depend on the target application's privilege level.\n   If the target runs as admin, MaaFramework should also run as admin for compatibility.\n - \"WithCursorPos\" methods briefly move the cursor to target position, send message,\n   then restore cursor position. This \"briefly\" seizes the mouse but won't block user operations.\n - \"WithWindowPos\" methods briefly move the window so the target aligns with the current cursor\n   position, send message, then restore the window position. The cursor is not moved."]
pub type MaaWin32InputMethod = u64;
#[doc = " @brief macOS screencap method\n\n Select ONE method only.\n\n | Method          | Description                                    |\n |-----------------|------------------------------------------------|\n | ScreenCaptureKit| Modern macOS screencap using ScreenCaptureKit  |"]
pub type MaaMacOSScreencapMethod = u64;
#[doc = " @brief macOS input method\n\n Select ONE method only.\n\n | Method          | Description                                    |\n |-----------------|------------------------------------------------|\n | GlobalEvent     | Injects into the global HID event stream via CGEventPost(kCGHIDEventTap), dispatched by the OS to the front window |\n | PostToPid       | Directly send to target process using CGEventPostToPid |"]
pub type MaaMacOSInputMethod = u64;
#[doc = " @brief Virtual gamepad type\n\n Select ONE type only.\n\n | Type          | Description                                    |\n |---------------|------------------------------------------------|\n | Xbox360       | Microsoft Xbox 360 Controller (wired)          |\n | DualShock4    | Sony DualShock 4 Controller (wired)            |"]
pub type MaaGamepadType = u64;
#[doc = " @brief Virtual gamepad button codes for click_key/key_down/key_up\n\n Use these values with MaaControllerPostClickKey, MaaControllerPostKeyDown, MaaControllerPostKeyUp.\n Values are based on XUSB (Xbox 360) button flags. DS4 face buttons are mapped to Xbox equivalents.\n\n Xbox 360 buttons:\n\n | Value   | Button              | Description            |\n |---------|---------------------|------------------------|\n | 0x1000  | A                   | A button               |\n | 0x2000  | B                   | B button               |\n | 0x4000  | X                   | X button               |\n | 0x8000  | Y                   | Y button               |\n | 0x0100  | LB (Left Shoulder)  | Left bumper            |\n | 0x0200  | RB (Right Shoulder) | Right bumper           |\n | 0x0040  | L_THUMB             | Left stick click       |\n | 0x0080  | R_THUMB             | Right stick click      |\n | 0x0010  | START               | Start button           |\n | 0x0020  | BACK                | Back button            |\n | 0x0400  | GUIDE               | Guide/Home button      |\n | 0x0001  | DPAD_UP             | D-pad up               |\n | 0x0002  | DPAD_DOWN           | D-pad down             |\n | 0x0004  | DPAD_LEFT           | D-pad left             |\n | 0x0008  | DPAD_RIGHT          | D-pad right            |\n\n DualShock 4 buttons (aliases to Xbox buttons):\n\n | Value   | Button    | Xbox Equivalent | Description               |\n |---------|-----------|-----------------|---------------------------|\n | 0x1000  | CROSS     | A                   | Cross (X) button          |\n | 0x2000  | CIRCLE    | B                   | Circle button             |\n | 0x4000  | SQUARE    | X                   | Square button             |\n | 0x8000  | TRIANGLE  | Y                   | Triangle button           |\n | 0x0100  | L1        | LB                  | L1 button                 |\n | 0x0200  | R1        | RB                  | R1 button                 |\n | 0x0040  | L3        | L_THUMB             | Left stick click          |\n | 0x0080  | R3        | R_THUMB             | Right stick click         |\n | 0x0010  | OPTIONS   | START               | Options button            |\n | 0x0020  | SHARE     | BACK                | Share button              |\n | 0x10000 | PS        | -                   | PS button (DS4 special)   |\n | 0x20000 | TOUCHPAD  | -                   | Touchpad click (DS4 only) |"]
pub type MaaGamepadButton = u64;
#[doc = " @brief Virtual gamepad touch contact definitions for touch_down/touch_move/touch_up\n\n For gamepad controller, the touch functions are repurposed for analog inputs:\n - x, y: Analog stick position\n - pressure: Trigger value (0~255)\n\n Contact mapping:\n\n | Contact | Input           | x range     | y range     | pressure   | Description                    |\n |---------|-----------------|-------------|-------------|------------|--------------------------------|\n | 0       | Left Stick      | -32768~32767| -32768~32767| ignored    | Left analog stick X/Y position |\n | 1       | Right Stick     | -32768~32767| -32768~32767| ignored    | Right analog stick X/Y position|\n | 2       | Left Trigger    | ignored     | ignored     | 0~255      | Left trigger (LT/L2) value     |\n | 3       | Right Trigger   | ignored     | ignored     | 0~255      | Right trigger (RT/R2) value    |\n\n Usage:\n - touch_down(contact, x, y, pressure): Start analog input\n - touch_move(contact, x, y, pressure): Update analog input position/value\n - touch_up(contact): Release/reset analog input to center/zero"]
pub type MaaGamepadTouch = u64;
#[doc = " Controller feature flags returned by get_features().\n These flags indicate which input methods the controller supports/prefers."]
pub type MaaControllerFeature = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaRect {
    pub x: i32,
    pub y: i32,
    pub width: i32,
    pub height: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of MaaRect"][::std::mem::size_of::<MaaRect>() - 16usize];
    ["Alignment of MaaRect"][::std::mem::align_of::<MaaRect>() - 4usize];
    ["Offset of field: MaaRect::x"][::std::mem::offset_of!(MaaRect, x) - 0usize];
    ["Offset of field: MaaRect::y"][::std::mem::offset_of!(MaaRect, y) - 4usize];
    ["Offset of field: MaaRect::width"][::std::mem::offset_of!(MaaRect, width) - 8usize];
    ["Offset of field: MaaRect::height"][::std::mem::offset_of!(MaaRect, height) - 12usize];
};
pub type MaaNotificationCallback = ::std::option::Option<
    unsafe extern "C" fn(
        message: *const ::std::os::raw::c_char,
        details_json: *const ::std::os::raw::c_char,
        notify_trans_arg: *mut ::std::os::raw::c_void,
    ),
>;
#[doc = " void* handle:\n - MaaTasker* for MaaTasker event\n - MaaResource* for MaaResource event\n - MaaController* for MaaController event\n - MaaContext* for MaaContext event"]
pub type MaaEventCallback = ::std::option::Option<
    unsafe extern "C" fn(
        handle: *mut ::std::os::raw::c_void,
        message: *const ::std::os::raw::c_char,
        details_json: *const ::std::os::raw::c_char,
        trans_arg: *mut ::std::os::raw::c_void,
    ),
>;
pub type MaaCustomRecognitionCallback = ::std::option::Option<
    unsafe extern "C" fn(
        context: *mut MaaContext,
        task_id: MaaTaskId,
        node_name: *const ::std::os::raw::c_char,
        custom_recognition_name: *const ::std::os::raw::c_char,
        custom_recognition_param: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
        roi: *const MaaRect,
        trans_arg: *mut ::std::os::raw::c_void,
        out_box: *mut MaaRect,
        out_detail: *mut MaaStringBuffer,
    ) -> MaaBool,
>;
pub type MaaCustomActionCallback = ::std::option::Option<
    unsafe extern "C" fn(
        context: *mut MaaContext,
        task_id: MaaTaskId,
        node_name: *const ::std::os::raw::c_char,
        custom_action_name: *const ::std::os::raw::c_char,
        custom_action_param: *const ::std::os::raw::c_char,
        reco_id: MaaRecoId,
        box_: *const MaaRect,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaBool,
>;
unsafe extern "C" {
    pub fn MaaTaskerCreate() -> *mut MaaTasker;
}
unsafe extern "C" {
    pub fn MaaTaskerDestroy(tasker: *mut MaaTasker);
}
unsafe extern "C" {
    pub fn MaaTaskerAddSink(
        tasker: *mut MaaTasker,
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaTaskerRemoveSink(tasker: *mut MaaTasker, sink_id: MaaSinkId);
}
unsafe extern "C" {
    pub fn MaaTaskerClearSinks(tasker: *mut MaaTasker);
}
unsafe extern "C" {
    pub fn MaaTaskerAddContextSink(
        tasker: *mut MaaTasker,
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaTaskerRemoveContextSink(tasker: *mut MaaTasker, sink_id: MaaSinkId);
}
unsafe extern "C" {
    pub fn MaaTaskerClearContextSinks(tasker: *mut MaaTasker);
}
unsafe extern "C" {
    #[doc = " @param[in] value"]
    pub fn MaaTaskerSetOption(
        tasker: *mut MaaTasker,
        key: MaaTaskerOption,
        value: MaaOptionValue,
        val_size: MaaOptionValueSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerBindResource(tasker: *mut MaaTasker, res: *mut MaaResource) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerBindController(tasker: *mut MaaTasker, ctrl: *mut MaaController) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerInited(tasker: *const MaaTasker) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerPostTask(
        tasker: *mut MaaTasker,
        entry: *const ::std::os::raw::c_char,
        pipeline_override: *const ::std::os::raw::c_char,
    ) -> MaaTaskId;
}
unsafe extern "C" {
    #[doc = " @param reco_type Recognition type string\n @param reco_param Recognition parameters json\n @param image Previous screenshot"]
    pub fn MaaTaskerPostRecognition(
        tasker: *mut MaaTasker,
        reco_type: *const ::std::os::raw::c_char,
        reco_param: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
    ) -> MaaTaskId;
}
unsafe extern "C" {
    #[doc = " @param action_type Action type string\n @param action_param Action parameters json\n @param box Previous recognition position\n @param reco_detail Previous recognition details"]
    pub fn MaaTaskerPostAction(
        tasker: *mut MaaTasker,
        action_type: *const ::std::os::raw::c_char,
        action_param: *const ::std::os::raw::c_char,
        box_: *const MaaRect,
        reco_detail: *const ::std::os::raw::c_char,
    ) -> MaaTaskId;
}
unsafe extern "C" {
    pub fn MaaTaskerStatus(tasker: *const MaaTasker, id: MaaTaskId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaTaskerWait(tasker: *const MaaTasker, id: MaaTaskId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaTaskerRunning(tasker: *const MaaTasker) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerPostStop(tasker: *mut MaaTasker) -> MaaTaskId;
}
unsafe extern "C" {
    pub fn MaaTaskerStopping(tasker: *const MaaTasker) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerGetResource(tasker: *const MaaTasker) -> *mut MaaResource;
}
unsafe extern "C" {
    pub fn MaaTaskerGetController(tasker: *const MaaTasker) -> *mut MaaController;
}
unsafe extern "C" {
    pub fn MaaTaskerClearCache(tasker: *mut MaaTasker) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaTaskerOverridePipeline(
        tasker: *mut MaaTasker,
        task_id: MaaTaskId,
        pipeline_override: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] hit"]
    pub fn MaaTaskerGetRecognitionDetail(
        tasker: *const MaaTasker,
        reco_id: MaaRecoId,
        node_name: *mut MaaStringBuffer,
        algorithm: *mut MaaStringBuffer,
        hit: *mut MaaBool,
        box_: *mut MaaRect,
        detail_json: *mut MaaStringBuffer,
        raw: *mut MaaImageBuffer,
        draws: *mut MaaImageListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] action\n @param[out] box\n @param[out] success\n @param[out] detail_json"]
    pub fn MaaTaskerGetActionDetail(
        tasker: *const MaaTasker,
        action_id: MaaActId,
        node_name: *mut MaaStringBuffer,
        action: *mut MaaStringBuffer,
        box_: *mut MaaRect,
        success: *mut MaaBool,
        detail_json: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] node_name\n @param[out] phase\n @param[out] success\n @param[out] elapsed_ms\n @param[out] reco_id_list\n @param[in, out] reco_id_list_size\n @param[out] roi"]
    pub fn MaaTaskerGetWaitFreezesDetail(
        tasker: *const MaaTasker,
        wf_id: MaaWfId,
        node_name: *mut MaaStringBuffer,
        phase: *mut MaaStringBuffer,
        success: *mut MaaBool,
        elapsed_ms: *mut MaaSize,
        reco_id_list: *mut MaaRecoId,
        reco_id_list_size: *mut MaaSize,
        roi: *mut MaaRect,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] reco_id\n @param[out] action_id\n @param[out] completed"]
    pub fn MaaTaskerGetNodeDetail(
        tasker: *const MaaTasker,
        node_id: MaaNodeId,
        node_name: *mut MaaStringBuffer,
        reco_id: *mut MaaRecoId,
        action_id: *mut MaaActId,
        completed: *mut MaaBool,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] node_id_list\n @param[in, out] node_id_list_size\n @param[out] status"]
    pub fn MaaTaskerGetTaskDetail(
        tasker: *const MaaTasker,
        task_id: MaaTaskId,
        entry: *mut MaaStringBuffer,
        node_id_list: *mut MaaNodeId,
        node_id_list_size: *mut MaaSize,
        status: *mut MaaStatus,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[out] latest_id"]
    pub fn MaaTaskerGetLatestNode(
        tasker: *const MaaTasker,
        node_name: *const ::std::os::raw::c_char,
        latest_id: *mut MaaNodeId,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceCreate() -> *mut MaaResource;
}
unsafe extern "C" {
    pub fn MaaResourceDestroy(res: *mut MaaResource);
}
unsafe extern "C" {
    pub fn MaaResourceAddSink(
        res: *mut MaaResource,
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaResourceRemoveSink(res: *mut MaaResource, sink_id: MaaSinkId);
}
unsafe extern "C" {
    pub fn MaaResourceClearSinks(res: *mut MaaResource);
}
unsafe extern "C" {
    pub fn MaaResourceRegisterCustomRecognition(
        res: *mut MaaResource,
        name: *const ::std::os::raw::c_char,
        recognition: MaaCustomRecognitionCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceUnregisterCustomRecognition(
        res: *mut MaaResource,
        name: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceClearCustomRecognition(res: *mut MaaResource) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceRegisterCustomAction(
        res: *mut MaaResource,
        name: *const ::std::os::raw::c_char,
        action: MaaCustomActionCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceUnregisterCustomAction(
        res: *mut MaaResource,
        name: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceClearCustomAction(res: *mut MaaResource) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourcePostBundle(
        res: *mut MaaResource,
        path: *const ::std::os::raw::c_char,
    ) -> MaaResId;
}
unsafe extern "C" {
    pub fn MaaResourcePostOcrModel(
        res: *mut MaaResource,
        path: *const ::std::os::raw::c_char,
    ) -> MaaResId;
}
unsafe extern "C" {
    pub fn MaaResourcePostPipeline(
        res: *mut MaaResource,
        path: *const ::std::os::raw::c_char,
    ) -> MaaResId;
}
unsafe extern "C" {
    pub fn MaaResourcePostImage(
        res: *mut MaaResource,
        path: *const ::std::os::raw::c_char,
    ) -> MaaResId;
}
unsafe extern "C" {
    pub fn MaaResourceOverridePipeline(
        res: *mut MaaResource,
        pipeline_override: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceOverrideNext(
        res: *mut MaaResource,
        node_name: *const ::std::os::raw::c_char,
        next_list: *const MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceOverrideImage(
        res: *mut MaaResource,
        image_name: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceGetNodeData(
        res: *mut MaaResource,
        node_name: *const ::std::os::raw::c_char,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceClear(res: *mut MaaResource) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceStatus(res: *const MaaResource, id: MaaResId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaResourceWait(res: *const MaaResource, id: MaaResId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaResourceLoaded(res: *const MaaResource) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceSetOption(
        res: *mut MaaResource,
        key: MaaResOption,
        value: MaaOptionValue,
        val_size: MaaOptionValueSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceGetHash(res: *const MaaResource, buffer: *mut MaaStringBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceGetNodeList(
        res: *const MaaResource,
        buffer: *mut MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceGetCustomRecognitionList(
        res: *const MaaResource,
        buffer: *mut MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaResourceGetCustomActionList(
        res: *const MaaResource,
        buffer: *mut MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @brief Get default recognition parameters for the specified type from DefaultPipelineMgr.\n\n @param reco_type Recognition type string (e.g., \"OCR\", \"TemplateMatch\")\n @param buffer [out] Output buffer for the JSON string of recognition parameters"]
    pub fn MaaResourceGetDefaultRecognitionParam(
        res: *const MaaResource,
        reco_type: *const ::std::os::raw::c_char,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @brief Get default action parameters for the specified type from DefaultPipelineMgr.\n\n @param action_type Action type string (e.g., \"Click\", \"Swipe\")\n @param buffer [out] Output buffer for the JSON string of action parameters"]
    pub fn MaaResourceGetDefaultActionParam(
        res: *const MaaResource,
        action_type: *const ::std::os::raw::c_char,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAdbControllerCreate(
        adb_path: *const ::std::os::raw::c_char,
        address: *const ::std::os::raw::c_char,
        screencap_methods: MaaAdbScreencapMethod,
        input_methods: MaaAdbInputMethod,
        config: *const ::std::os::raw::c_char,
        agent_path: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    pub fn MaaWin32ControllerCreate(
        hWnd: *mut ::std::os::raw::c_void,
        screencap_method: MaaWin32ScreencapMethod,
        mouse_method: MaaWin32InputMethod,
        keyboard_method: MaaWin32InputMethod,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a macOS controller for native macOS applications.\n\n @param window_id The CGWindowID of the target window (0 for desktop).\n @param screencap_method macOS screencap method to use.\n @param input_method macOS input method to use.\n @return The controller handle, or nullptr on failure.\n\n @note This controller is designed for native macOS applications.\n @note Requires Screen Recording permission for screencap.\n @note Input simulation requires Accessibility permission.\n @note Some features are not supported: start_app, stop_app, scroll.\n @note Only single touch is supported (contact must be 0)."]
    pub fn MaaMacOSControllerCreate(
        window_id: u32,
        screencap_method: MaaMacOSScreencapMethod,
        input_method: MaaMacOSInputMethod,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create an Android native controller backed by MaaAndroidNativeControlUnit.\n\n @param config_json JSON config for the control unit. Required fields:\n                    - library_path: path to the Android native control unit library\n                    - screen_resolution.width / screen_resolution.height: raw screenshot and touch resolution\n                    Optional fields:\n                    - display_id: target display id, defaults to 0\n                    - force_stop: whether to force stop before start_app, defaults to false\n @return The controller handle, or nullptr on failure.\n\n @note This controller is only available on Android.\n @note The configured screen_resolution must match the control unit's raw screenshot/touch coordinate space."]
    pub fn MaaAndroidNativeControllerCreate(
        config_json: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    pub fn MaaCustomControllerCreate(
        controller: *mut MaaCustomControllerCallbacks,
        controller_arg: *mut ::std::os::raw::c_void,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a debug controller that serves images from a directory.\n\n @param read_path Path to a directory of images (or a single image file).\n                  Images are loaded on connect and cycled through on each screencap request.\n                  All input operations (click, swipe, etc.) are no-ops that return success.\n @return The controller handle, or nullptr on failure."]
    pub fn MaaDbgControllerCreate(read_path: *const ::std::os::raw::c_char) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a replay controller that replays recorded operations.\n\n @param recording_path Path to the recording JSONL file written by MaaRecordControllerCreate.\n                       Screenshot image paths in the file are resolved relative to this file's parent directory.\n @return The controller handle, or nullptr on failure."]
    pub fn MaaReplayControllerCreate(
        recording_path: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a record controller that wraps an existing controller and records all operations.\n\n @param inner The inner controller to forward all operations to. Must not be null.\n              The record controller does NOT take ownership of the inner controller.\n @param recording_path Path to the recording JSONL file to write.\n                       Screenshot images will be saved to a \"{stem}-Screenshot\" folder\n                       in the same directory as this file.\n                       The recorded file can be replayed using MaaReplayControllerCreate.\n @return The record controller handle, or nullptr on failure."]
    pub fn MaaRecordControllerCreate(
        inner: *mut MaaController,
        recording_path: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a PlayCover controller for macOS.\n\n @param address The PlayTools service address in \"host:port\" format.\n @param uuid The application bundle identifier (e.g., \"com.hypergryph.arknights\").\n @return The controller handle, or nullptr on failure.\n\n @note This controller is designed for PlayCover on macOS.\n @note Some features are not supported: start_app, input_text, click_key, key_down, key_up, scroll.\n @note Only single touch is supported (contact must be 0)."]
    pub fn MaaPlayCoverControllerCreate(
        address: *const ::std::os::raw::c_char,
        uuid: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a wlroots controller for Linux.\n\n @param wlr_socket_path The wayland socket path (e.g., \"/run/user/1000/wayland-0\").\n @return The controller handle, or nullptr on failure.\n\n @note This controller is designed for wlroots on Linux."]
    pub fn MaaWlRootsControllerCreate(
        wlr_socket_path: *const ::std::os::raw::c_char,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    #[doc = " @brief Create a virtual gamepad controller for Windows.\n\n @param hWnd Window handle for screencap (optional, can be nullptr if screencap not needed).\n @param gamepad_type Type of virtual gamepad (MaaGamepadType_Xbox360 or MaaGamepadType_DualShock4).\n @param screencap_method Win32 screencap method to use. Ignored if hWnd is nullptr.\n @return The controller handle, or nullptr on failure.\n\n @note Requires ViGEm Bus Driver to be installed on the system.\n @note For gamepad control, use:\n       - click_key/key_down/key_up: For digital buttons (A, B, X, Y, LB, RB, etc.)\n         See MaaGamepadButton_* constants for available buttons.\n       - touch_down/touch_move/touch_up: For analog inputs (sticks and triggers)\n         - contact 0 (MaaGamepadTouch_LeftStick): Left stick (x: -32768~32767, y: -32768~32767)\n         - contact 1 (MaaGamepadTouch_RightStick): Right stick (x: -32768~32767, y: -32768~32767)\n         - contact 2 (MaaGamepadTouch_LeftTrigger): Left trigger (pressure: 0~255, x/y ignored)\n         - contact 3 (MaaGamepadTouch_RightTrigger): Right trigger (pressure: 0~255, x/y ignored)\n @note click and swipe are not directly supported for gamepad.\n @note input_text, start_app, stop_app, scroll are not supported.\n @see MaaGamepadButton, MaaGamepadTouch, MaaGamepadType"]
    pub fn MaaGamepadControllerCreate(
        hWnd: *mut ::std::os::raw::c_void,
        gamepad_type: MaaGamepadType,
        screencap_method: MaaWin32ScreencapMethod,
    ) -> *mut MaaController;
}
unsafe extern "C" {
    pub fn MaaControllerDestroy(ctrl: *mut MaaController);
}
unsafe extern "C" {
    pub fn MaaControllerAddSink(
        ctrl: *mut MaaController,
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaControllerRemoveSink(ctrl: *mut MaaController, sink_id: MaaSinkId);
}
unsafe extern "C" {
    pub fn MaaControllerClearSinks(ctrl: *mut MaaController);
}
unsafe extern "C" {
    #[doc = " @param[in] value"]
    pub fn MaaControllerSetOption(
        ctrl: *mut MaaController,
        key: MaaCtrlOption,
        value: MaaOptionValue,
        val_size: MaaOptionValueSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaControllerPostConnection(ctrl: *mut MaaController) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostClick(ctrl: *mut MaaController, x: i32, y: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostClickV2(
        ctrl: *mut MaaController,
        x: i32,
        y: i32,
        contact: i32,
        pressure: i32,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostSwipe(
        ctrl: *mut MaaController,
        x1: i32,
        y1: i32,
        x2: i32,
        y2: i32,
        duration: i32,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostSwipeV2(
        ctrl: *mut MaaController,
        x1: i32,
        y1: i32,
        x2: i32,
        y2: i32,
        duration: i32,
        contact: i32,
        pressure: i32,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostClickKey(ctrl: *mut MaaController, keycode: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostInputText(
        ctrl: *mut MaaController,
        text: *const ::std::os::raw::c_char,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostStartApp(
        ctrl: *mut MaaController,
        intent: *const ::std::os::raw::c_char,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostStopApp(
        ctrl: *mut MaaController,
        intent: *const ::std::os::raw::c_char,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostTouchDown(
        ctrl: *mut MaaController,
        contact: i32,
        x: i32,
        y: i32,
        pressure: i32,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostTouchMove(
        ctrl: *mut MaaController,
        contact: i32,
        x: i32,
        y: i32,
        pressure: i32,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostTouchUp(ctrl: *mut MaaController, contact: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostRelativeMove(ctrl: *mut MaaController, dx: i32, dy: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostKeyDown(ctrl: *mut MaaController, keycode: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaControllerPostKeyUp(ctrl: *mut MaaController, keycode: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    #[doc = " @brief Post a screenshot request to the controller.\n\n @param ctrl The controller handle.\n @return The control id of the screenshot action.\n\n @note The screenshot image is scaled according to the screenshot target size settings (long side / short side).\n       Use MaaControllerGetResolution to get the raw (unscaled) device resolution.\n @see MaaControllerCachedImage, MaaControllerSetOption, MaaControllerGetResolution"]
    pub fn MaaControllerPostScreencap(ctrl: *mut MaaController) -> MaaCtrlId;
}
unsafe extern "C" {
    #[doc = " @brief Post a scroll action to the controller.\n\n @param ctrl The controller handle.\n @param dx The horizontal scroll delta. Positive values scroll right, negative values scroll left.\n @param dy The vertical scroll delta. Positive values scroll up, negative values scroll down.\n @return The control id of the scroll action.\n\n @note Scroll is supported by Win32 controllers and custom controllers that implement scroll.\n @note If the controller does not support scroll, the action will fail. Use MaaControllerStatus or\n MaaControllerWait to check the result.\n @note The dx/dy values are sent directly as scroll increments. Using multiples of 120 (WHEEL_DELTA) is\n recommended for best compatibility."]
    pub fn MaaControllerPostScroll(ctrl: *mut MaaController, dx: i32, dy: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    #[doc = " @brief Post an inactive request to the controller.\n\n @param ctrl The controller handle.\n @return The control id of the inactive action.\n\n @note For Win32 controllers, this restores window position (removes topmost) and unblocks user input.\n @note For other controllers, this is a no-op that always succeeds."]
    pub fn MaaControllerPostInactive(ctrl: *mut MaaController) -> MaaCtrlId;
}
unsafe extern "C" {
    #[doc = " @brief Post a shell command to the controller.\n\n @param ctrl The controller handle.\n @param cmd The shell command to execute.\n @param timeout Timeout in milliseconds. Default is 20000 (20 seconds).\n @return The control id of the shell action.\n\n @note Supported by ADB controllers and custom controllers that implement the shell callback.\n @see MaaControllerGetShellOutput"]
    pub fn MaaControllerPostShell(
        ctrl: *mut MaaController,
        cmd: *const ::std::os::raw::c_char,
        timeout: i64,
    ) -> MaaCtrlId;
}
unsafe extern "C" {
    #[doc = " @brief Get the cached shell command output.\n\n @param ctrl The controller handle.\n @param buffer The output buffer to store the command result.\n @return true if the output is available, false otherwise.\n\n @note This returns the output from the most recent shell command execution."]
    pub fn MaaControllerGetShellOutput(
        ctrl: *const MaaController,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaControllerStatus(ctrl: *const MaaController, id: MaaCtrlId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaControllerWait(ctrl: *const MaaController, id: MaaCtrlId) -> MaaStatus;
}
unsafe extern "C" {
    pub fn MaaControllerConnected(ctrl: *const MaaController) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @brief Get the cached screenshot image.\n\n @param ctrl The controller handle.\n @param buffer The output buffer to store the screenshot image.\n @return true if the screenshot is available, false otherwise.\n\n @note The returned image is scaled according to the screenshot target size settings (long side / short side).\n       The image dimensions may differ from the raw device resolution.\n       Use MaaControllerGetResolution to get the raw (unscaled) device resolution.\n @see MaaControllerPostScreencap, MaaControllerSetOption, MaaControllerGetResolution"]
    pub fn MaaControllerCachedImage(
        ctrl: *const MaaController,
        buffer: *mut MaaImageBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaControllerGetUuid(ctrl: *mut MaaController, buffer: *mut MaaStringBuffer) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @brief Get the raw (unscaled) device resolution.\n\n @param ctrl The controller handle.\n @param[out] width Output parameter for the raw width.\n @param[out] height Output parameter for the raw height.\n @return true if the resolution is available, false otherwise (e.g., not connected or no screenshot taken yet).\n\n @note This returns the actual device screen resolution before any scaling.\n       The screenshot obtained via MaaControllerCachedImage is scaled according to the screenshot target size settings,\n       so its dimensions may differ from this raw resolution.\n @see MaaControllerCachedImage, MaaControllerPostScreencap"]
    pub fn MaaControllerGetResolution(
        ctrl: *const MaaController,
        width: *mut i32,
        height: *mut i32,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @brief Get controller information as a JSON string.\n\n @param ctrl The controller handle.\n @param buffer The output buffer to store the JSON string.\n @return true if the info is available, false otherwise.\n\n @note Returns controller-specific information including type, constructor parameters and current state.\n       The returned JSON always contains a \"type\" field indicating the controller type."]
    pub fn MaaControllerGetInfo(
        ctrl: *const MaaController,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaControllerPostPressKey(ctrl: *mut MaaController, keycode: i32) -> MaaCtrlId;
}
unsafe extern "C" {
    pub fn MaaContextRunTask(
        context: *mut MaaContext,
        entry: *const ::std::os::raw::c_char,
        pipeline_override: *const ::std::os::raw::c_char,
    ) -> MaaTaskId;
}
unsafe extern "C" {
    pub fn MaaContextRunRecognition(
        context: *mut MaaContext,
        entry: *const ::std::os::raw::c_char,
        pipeline_override: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
    ) -> MaaRecoId;
}
unsafe extern "C" {
    pub fn MaaContextRunAction(
        context: *mut MaaContext,
        entry: *const ::std::os::raw::c_char,
        pipeline_override: *const ::std::os::raw::c_char,
        box_: *const MaaRect,
        reco_detail: *const ::std::os::raw::c_char,
    ) -> MaaActId;
}
unsafe extern "C" {
    #[doc = " @brief Run recognition directly with type and parameters, without requiring a pipeline entry.\n\n @param reco_type Recognition type string (e.g., \"OCR\", \"TemplateMatch\")\n @param reco_param Recognition parameters json\n @param image Image to recognize"]
    pub fn MaaContextRunRecognitionDirect(
        context: *mut MaaContext,
        reco_type: *const ::std::os::raw::c_char,
        reco_param: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
    ) -> MaaRecoId;
}
unsafe extern "C" {
    #[doc = " @brief Run action directly with type and parameters, without requiring a pipeline entry.\n\n @param action_type Action type string (e.g., \"Click\", \"Swipe\")\n @param action_param Action parameters json\n @param box Previous recognition position\n @param reco_detail Previous recognition details"]
    pub fn MaaContextRunActionDirect(
        context: *mut MaaContext,
        action_type: *const ::std::os::raw::c_char,
        action_param: *const ::std::os::raw::c_char,
        box_: *const MaaRect,
        reco_detail: *const ::std::os::raw::c_char,
    ) -> MaaActId;
}
unsafe extern "C" {
    pub fn MaaContextWaitFreezes(
        context: *mut MaaContext,
        time: MaaSize,
        box_: *const MaaRect,
        wait_freezes_param: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextOverridePipeline(
        context: *mut MaaContext,
        pipeline_override: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextOverrideNext(
        context: *mut MaaContext,
        node_name: *const ::std::os::raw::c_char,
        next_list: *const MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextOverrideImage(
        context: *mut MaaContext,
        image_name: *const ::std::os::raw::c_char,
        image: *const MaaImageBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextGetNodeData(
        context: *mut MaaContext,
        node_name: *const ::std::os::raw::c_char,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextGetTaskId(context: *const MaaContext) -> MaaTaskId;
}
unsafe extern "C" {
    pub fn MaaContextGetTasker(context: *const MaaContext) -> *mut MaaTasker;
}
unsafe extern "C" {
    pub fn MaaContextClone(context: *const MaaContext) -> *mut MaaContext;
}
unsafe extern "C" {
    pub fn MaaContextSetAnchor(
        context: *mut MaaContext,
        anchor_name: *const ::std::os::raw::c_char,
        node_name: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextGetAnchor(
        context: *mut MaaContext,
        anchor_name: *const ::std::os::raw::c_char,
        buffer: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextGetHitCount(
        context: *mut MaaContext,
        node_name: *const ::std::os::raw::c_char,
        count: *mut MaaSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaContextClearHitCount(
        context: *mut MaaContext,
        node_name: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " @param[in] value"]
    pub fn MaaGlobalSetOption(
        key: MaaGlobalOption,
        value: MaaOptionValue,
        val_size: MaaOptionValueSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    #[doc = " load a plugin with full path or name only, name only will search in system directory and current directory\n or\n load plugins with recursive search in the directory"]
    pub fn MaaGlobalLoadPlugin(library_path: *const ::std::os::raw::c_char) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaSetGlobalOption(
        key: MaaGlobalOption,
        value: MaaOptionValue,
        val_size: MaaOptionValueSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringBufferCreate() -> *mut MaaStringBuffer;
}
unsafe extern "C" {
    pub fn MaaStringBufferDestroy(handle: *mut MaaStringBuffer);
}
unsafe extern "C" {
    pub fn MaaStringBufferIsEmpty(handle: *const MaaStringBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringBufferClear(handle: *mut MaaStringBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringBufferGet(handle: *const MaaStringBuffer) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaStringBufferSize(handle: *const MaaStringBuffer) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaStringBufferSet(
        handle: *mut MaaStringBuffer,
        str_: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringBufferSetEx(
        handle: *mut MaaStringBuffer,
        str_: *const ::std::os::raw::c_char,
        size: MaaSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringListBufferCreate() -> *mut MaaStringListBuffer;
}
unsafe extern "C" {
    pub fn MaaStringListBufferDestroy(handle: *mut MaaStringListBuffer);
}
unsafe extern "C" {
    pub fn MaaStringListBufferIsEmpty(handle: *const MaaStringListBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringListBufferSize(handle: *const MaaStringListBuffer) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaStringListBufferAt(
        handle: *const MaaStringListBuffer,
        index: MaaSize,
    ) -> *const MaaStringBuffer;
}
unsafe extern "C" {
    pub fn MaaStringListBufferAppend(
        handle: *mut MaaStringListBuffer,
        value: *const MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringListBufferRemove(handle: *mut MaaStringListBuffer, index: MaaSize) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaStringListBufferClear(handle: *mut MaaStringListBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageBufferCreate() -> *mut MaaImageBuffer;
}
unsafe extern "C" {
    pub fn MaaImageBufferDestroy(handle: *mut MaaImageBuffer);
}
unsafe extern "C" {
    pub fn MaaImageBufferIsEmpty(handle: *const MaaImageBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageBufferClear(handle: *mut MaaImageBuffer) -> MaaBool;
}
pub type MaaImageRawData = *mut ::std::os::raw::c_void;
unsafe extern "C" {
    pub fn MaaImageBufferGetRawData(handle: *const MaaImageBuffer) -> MaaImageRawData;
}
unsafe extern "C" {
    pub fn MaaImageBufferWidth(handle: *const MaaImageBuffer) -> i32;
}
unsafe extern "C" {
    pub fn MaaImageBufferHeight(handle: *const MaaImageBuffer) -> i32;
}
unsafe extern "C" {
    pub fn MaaImageBufferChannels(handle: *const MaaImageBuffer) -> i32;
}
unsafe extern "C" {
    pub fn MaaImageBufferType(handle: *const MaaImageBuffer) -> i32;
}
unsafe extern "C" {
    pub fn MaaImageBufferSetRawData(
        handle: *mut MaaImageBuffer,
        data: MaaImageRawData,
        width: i32,
        height: i32,
        type_: i32,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageBufferResize(handle: *mut MaaImageBuffer, width: i32, height: i32) -> MaaBool;
}
pub type MaaImageEncodedData = *mut u8;
unsafe extern "C" {
    pub fn MaaImageBufferGetEncoded(handle: *const MaaImageBuffer) -> MaaImageEncodedData;
}
unsafe extern "C" {
    pub fn MaaImageBufferGetEncodedSize(handle: *const MaaImageBuffer) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaImageBufferSetEncoded(
        handle: *mut MaaImageBuffer,
        data: MaaImageEncodedData,
        size: MaaSize,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageListBufferCreate() -> *mut MaaImageListBuffer;
}
unsafe extern "C" {
    pub fn MaaImageListBufferDestroy(handle: *mut MaaImageListBuffer);
}
unsafe extern "C" {
    pub fn MaaImageListBufferIsEmpty(handle: *const MaaImageListBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageListBufferSize(handle: *const MaaImageListBuffer) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaImageListBufferAt(
        handle: *const MaaImageListBuffer,
        index: MaaSize,
    ) -> *const MaaImageBuffer;
}
unsafe extern "C" {
    pub fn MaaImageListBufferAppend(
        handle: *mut MaaImageListBuffer,
        value: *const MaaImageBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageListBufferRemove(handle: *mut MaaImageListBuffer, index: MaaSize) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaImageListBufferClear(handle: *mut MaaImageListBuffer) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaRectCreate() -> *mut MaaRect;
}
unsafe extern "C" {
    pub fn MaaRectDestroy(handle: *mut MaaRect);
}
unsafe extern "C" {
    pub fn MaaRectGetX(handle: *const MaaRect) -> i32;
}
unsafe extern "C" {
    pub fn MaaRectGetY(handle: *const MaaRect) -> i32;
}
unsafe extern "C" {
    pub fn MaaRectGetW(handle: *const MaaRect) -> i32;
}
unsafe extern "C" {
    pub fn MaaRectGetH(handle: *const MaaRect) -> i32;
}
unsafe extern "C" {
    pub fn MaaRectSet(handle: *mut MaaRect, x: i32, y: i32, w: i32, h: i32) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaVersion() -> *const ::std::os::raw::c_char;
}
#[doc = " @brief The custom controller API.\n\n To create a custom controller, you need to implement this API.\n\n You do not have to implement all the functions in this API. Instead, just implement the\n functions you need. Do note that if an unimplemented function is called, the framework will\n likely crash."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaCustomControllerCallbacks {
    pub connect: ::std::option::Option<
        unsafe extern "C" fn(trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub connected: ::std::option::Option<
        unsafe extern "C" fn(trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    #[doc = " Write result to buffer."]
    pub request_uuid: ::std::option::Option<
        unsafe extern "C" fn(
            trans_arg: *mut ::std::os::raw::c_void,
            buffer: *mut MaaStringBuffer,
        ) -> MaaBool,
    >,
    pub get_features: ::std::option::Option<
        unsafe extern "C" fn(trans_arg: *mut ::std::os::raw::c_void) -> MaaControllerFeature,
    >,
    pub start_app: ::std::option::Option<
        unsafe extern "C" fn(
            intent: *const ::std::os::raw::c_char,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    pub stop_app: ::std::option::Option<
        unsafe extern "C" fn(
            intent: *const ::std::os::raw::c_char,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    #[doc = " Write result to buffer."]
    pub screencap: ::std::option::Option<
        unsafe extern "C" fn(
            trans_arg: *mut ::std::os::raw::c_void,
            buffer: *mut MaaImageBuffer,
        ) -> MaaBool,
    >,
    pub click: ::std::option::Option<
        unsafe extern "C" fn(x: i32, y: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub swipe: ::std::option::Option<
        unsafe extern "C" fn(
            x1: i32,
            y1: i32,
            x2: i32,
            y2: i32,
            duration: i32,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    pub touch_down: ::std::option::Option<
        unsafe extern "C" fn(
            contact: i32,
            x: i32,
            y: i32,
            pressure: i32,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    pub touch_move: ::std::option::Option<
        unsafe extern "C" fn(
            contact: i32,
            x: i32,
            y: i32,
            pressure: i32,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    pub touch_up: ::std::option::Option<
        unsafe extern "C" fn(contact: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub click_key: ::std::option::Option<
        unsafe extern "C" fn(keycode: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub input_text: ::std::option::Option<
        unsafe extern "C" fn(
            text: *const ::std::os::raw::c_char,
            trans_arg: *mut ::std::os::raw::c_void,
        ) -> MaaBool,
    >,
    pub key_down: ::std::option::Option<
        unsafe extern "C" fn(keycode: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub key_up: ::std::option::Option<
        unsafe extern "C" fn(keycode: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub scroll: ::std::option::Option<
        unsafe extern "C" fn(dx: i32, dy: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    pub relative_move: ::std::option::Option<
        unsafe extern "C" fn(dx: i32, dy: i32, trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    #[doc = " Write result to buffer."]
    pub shell: ::std::option::Option<
        unsafe extern "C" fn(
            cmd: *const ::std::os::raw::c_char,
            timeout: i64,
            trans_arg: *mut ::std::os::raw::c_void,
            buffer: *mut MaaStringBuffer,
        ) -> MaaBool,
    >,
    pub inactive: ::std::option::Option<
        unsafe extern "C" fn(trans_arg: *mut ::std::os::raw::c_void) -> MaaBool,
    >,
    #[doc = " Write result (JSON string) to buffer. Optional, can be NULL."]
    pub get_info: ::std::option::Option<
        unsafe extern "C" fn(
            trans_arg: *mut ::std::os::raw::c_void,
            buffer: *mut MaaStringBuffer,
        ) -> MaaBool,
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of MaaCustomControllerCallbacks"]
        [::std::mem::size_of::<MaaCustomControllerCallbacks>() - 168usize];
    ["Alignment of MaaCustomControllerCallbacks"]
        [::std::mem::align_of::<MaaCustomControllerCallbacks>() - 8usize];
    ["Offset of field: MaaCustomControllerCallbacks::connect"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, connect) - 0usize];
    ["Offset of field: MaaCustomControllerCallbacks::connected"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, connected) - 8usize];
    ["Offset of field: MaaCustomControllerCallbacks::request_uuid"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, request_uuid) - 16usize];
    ["Offset of field: MaaCustomControllerCallbacks::get_features"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, get_features) - 24usize];
    ["Offset of field: MaaCustomControllerCallbacks::start_app"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, start_app) - 32usize];
    ["Offset of field: MaaCustomControllerCallbacks::stop_app"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, stop_app) - 40usize];
    ["Offset of field: MaaCustomControllerCallbacks::screencap"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, screencap) - 48usize];
    ["Offset of field: MaaCustomControllerCallbacks::click"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, click) - 56usize];
    ["Offset of field: MaaCustomControllerCallbacks::swipe"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, swipe) - 64usize];
    ["Offset of field: MaaCustomControllerCallbacks::touch_down"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, touch_down) - 72usize];
    ["Offset of field: MaaCustomControllerCallbacks::touch_move"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, touch_move) - 80usize];
    ["Offset of field: MaaCustomControllerCallbacks::touch_up"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, touch_up) - 88usize];
    ["Offset of field: MaaCustomControllerCallbacks::click_key"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, click_key) - 96usize];
    ["Offset of field: MaaCustomControllerCallbacks::input_text"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, input_text) - 104usize];
    ["Offset of field: MaaCustomControllerCallbacks::key_down"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, key_down) - 112usize];
    ["Offset of field: MaaCustomControllerCallbacks::key_up"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, key_up) - 120usize];
    ["Offset of field: MaaCustomControllerCallbacks::scroll"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, scroll) - 128usize];
    ["Offset of field: MaaCustomControllerCallbacks::relative_move"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, relative_move) - 136usize];
    ["Offset of field: MaaCustomControllerCallbacks::shell"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, shell) - 144usize];
    ["Offset of field: MaaCustomControllerCallbacks::inactive"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, inactive) - 152usize];
    ["Offset of field: MaaCustomControllerCallbacks::get_info"]
        [::std::mem::offset_of!(MaaCustomControllerCallbacks, get_info) - 160usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaAgentClient {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn MaaAgentClientCreateV2(identifier: *const MaaStringBuffer) -> *mut MaaAgentClient;
}
unsafe extern "C" {
    pub fn MaaAgentClientCreateTcp(port: u16) -> *mut MaaAgentClient;
}
unsafe extern "C" {
    pub fn MaaAgentClientDestroy(client: *mut MaaAgentClient);
}
unsafe extern "C" {
    pub fn MaaAgentClientIdentifier(
        client: *mut MaaAgentClient,
        identifier: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientBindResource(
        client: *mut MaaAgentClient,
        res: *mut MaaResource,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientRegisterResourceSink(
        client: *mut MaaAgentClient,
        res: *mut MaaResource,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientRegisterControllerSink(
        client: *mut MaaAgentClient,
        ctrl: *mut MaaController,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientRegisterTaskerSink(
        client: *mut MaaAgentClient,
        tasker: *mut MaaTasker,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientConnect(client: *mut MaaAgentClient) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientDisconnect(client: *mut MaaAgentClient) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientConnected(client: *mut MaaAgentClient) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientAlive(client: *mut MaaAgentClient) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientSetTimeout(client: *mut MaaAgentClient, milliseconds: i64) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientGetCustomRecognitionList(
        client: *mut MaaAgentClient,
        buffer: *mut MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientGetCustomActionList(
        client: *mut MaaAgentClient,
        buffer: *mut MaaStringListBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentClientCreate() -> *mut MaaAgentClient;
}
unsafe extern "C" {
    pub fn MaaAgentClientCreateSocket(
        client: *mut MaaAgentClient,
        identifier: *mut MaaStringBuffer,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentServerRegisterCustomRecognition(
        name: *const ::std::os::raw::c_char,
        recognition: MaaCustomRecognitionCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentServerRegisterCustomAction(
        name: *const ::std::os::raw::c_char,
        action: MaaCustomActionCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentServerAddResourceSink(
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaAgentServerAddControllerSink(
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaAgentServerAddTaskerSink(
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaAgentServerAddContextSink(
        sink: MaaEventCallback,
        trans_arg: *mut ::std::os::raw::c_void,
    ) -> MaaSinkId;
}
unsafe extern "C" {
    pub fn MaaAgentServerStartUp(identifier: *const ::std::os::raw::c_char) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaAgentServerShutDown();
}
unsafe extern "C" {
    pub fn MaaAgentServerJoin();
}
unsafe extern "C" {
    pub fn MaaAgentServerDetach();
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaToolkitAdbDevice {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaToolkitAdbDeviceList {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaToolkitDesktopWindow {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MaaToolkitDesktopWindowList {
    _unused: [u8; 0],
}
pub const MaaMacOSPermissionEnum_MaaMacOSPermissionScreenCapture: MaaMacOSPermissionEnum = 1;
pub const MaaMacOSPermissionEnum_MaaMacOSPermissionAccessibility: MaaMacOSPermissionEnum = 2;
pub type MaaMacOSPermissionEnum = ::std::os::raw::c_uint;
pub type MaaMacOSPermission = i32;
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceListCreate() -> *mut MaaToolkitAdbDeviceList;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceListDestroy(handle: *mut MaaToolkitAdbDeviceList);
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceFind(buffer: *mut MaaToolkitAdbDeviceList) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceFindSpecified(
        adb_path: *const ::std::os::raw::c_char,
        buffer: *mut MaaToolkitAdbDeviceList,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceListSize(list: *const MaaToolkitAdbDeviceList) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceListAt(
        list: *const MaaToolkitAdbDeviceList,
        index: MaaSize,
    ) -> *const MaaToolkitAdbDevice;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetName(
        device: *const MaaToolkitAdbDevice,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetAdbPath(
        device: *const MaaToolkitAdbDevice,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetAddress(
        device: *const MaaToolkitAdbDevice,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetScreencapMethods(
        device: *const MaaToolkitAdbDevice,
    ) -> MaaAdbScreencapMethod;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetInputMethods(
        device: *const MaaToolkitAdbDevice,
    ) -> MaaAdbInputMethod;
}
unsafe extern "C" {
    pub fn MaaToolkitAdbDeviceGetConfig(
        device: *const MaaToolkitAdbDevice,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowListCreate() -> *mut MaaToolkitDesktopWindowList;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowListDestroy(handle: *mut MaaToolkitDesktopWindowList);
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowFindAll(buffer: *mut MaaToolkitDesktopWindowList) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowListSize(list: *const MaaToolkitDesktopWindowList) -> MaaSize;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowListAt(
        list: *const MaaToolkitDesktopWindowList,
        index: MaaSize,
    ) -> *const MaaToolkitDesktopWindow;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowGetHandle(
        window: *const MaaToolkitDesktopWindow,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowGetClassName(
        window: *const MaaToolkitDesktopWindow,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitDesktopWindowGetWindowName(
        window: *const MaaToolkitDesktopWindow,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn MaaToolkitConfigInitOption(
        user_path: *const ::std::os::raw::c_char,
        default_json: *const ::std::os::raw::c_char,
    ) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitMacOSCheckPermission(perm: MaaMacOSPermission) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitMacOSRequestPermission(perm: MaaMacOSPermission) -> MaaBool;
}
unsafe extern "C" {
    pub fn MaaToolkitMacOSRevealPermissionSettings(perm: MaaMacOSPermission) -> MaaBool;
}