/* 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 @param use_win32_vk_code If true, key codes passed to click_key / key_down / key_up are\n interpreted as Win32 Virtual-Key codes (VK_*) and translated to Linux evdev codes\n internally. If false, key codes are passed through as raw evdev codes.\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,
use_win32_vk_code: MaaBool,
) -> *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;
}