Maa Framework (main) v2.2.0-beta.3
A automation black-box testing framework based on image recognition.
Loading...
Searching...
No Matches
MaaDef.h
Go to the documentation of this file.
1
10// IWYU pragma: private, include <MaaFramework/MaaAPI.h>
11
12#pragma once
13
14#include <stdint.h>
15
16#include "MaaPort.h" // IWYU pragma: export
17
18typedef uint8_t MaaBool;
19typedef uint64_t MaaSize;
20#define MaaNullSize UINT64_MAX
21
22typedef int64_t MaaId;
28#define MaaInvalidId ((MaaId)0)
29
34
35typedef struct MaaResource MaaResource;
37typedef struct MaaTasker MaaTasker;
38typedef struct MaaContext MaaContext;
39
40typedef int32_t MaaStatus;
41
43{
49 // MaaStatus_Timeout = 5000,
50};
51
52typedef int32_t MaaLoggingLevel;
53
65
66typedef int32_t MaaOption;
67typedef void* MaaOptionValue;
68typedef uint64_t MaaOptionValueSize;
69
71
108
110
111typedef int32_t MaaInferenceDevice;
112
121
133
135
168
170
175
176// MaaAdbScreencapMethod:
180typedef uint64_t MaaAdbScreencapMethod;
181#define MaaAdbScreencapMethod_None 0ULL
182#define MaaAdbScreencapMethod_EncodeToFileAndPull 1ULL
183#define MaaAdbScreencapMethod_Encode (1ULL << 1)
184#define MaaAdbScreencapMethod_RawWithGzip (1ULL << 2)
185#define MaaAdbScreencapMethod_RawByNetcat (1ULL << 3)
186#define MaaAdbScreencapMethod_MinicapDirect (1ULL << 4)
187#define MaaAdbScreencapMethod_MinicapStream (1ULL << 5)
188#define MaaAdbScreencapMethod_EmulatorExtras (1ULL << 6)
189
190#define MaaAdbScreencapMethod_All (~MaaAdbScreencapMethod_None)
191#define MaaAdbScreencapMethod_Default \
192 (MaaAdbScreencapMethod_All & (~MaaAdbScreencapMethod_RawByNetcat) & (~MaaAdbScreencapMethod_MinicapDirect) \
193 & (~MaaAdbScreencapMethod_MinicapStream))
194
195// MaaAdbInputMethod:
200typedef uint64_t MaaAdbInputMethod;
201#define MaaAdbInputMethod_None 0ULL
202#define MaaAdbInputMethod_AdbShell 1ULL
203#define MaaAdbInputMethod_MinitouchAndAdbKey (1ULL << 1)
204#define MaaAdbInputMethod_Maatouch (1ULL << 2)
205#define MaaAdbInputMethod_EmulatorExtras (1ULL << 3)
206
207#define MaaAdbInputMethod_All (~MaaAdbInputMethod_None)
208#define MaaAdbInputMethod_Default (MaaAdbInputMethod_All & (~MaaAdbInputMethod_EmulatorExtras))
209
210// MaaWin32ScreencapMethod:
214typedef uint64_t MaaWin32ScreencapMethod;
215#define MaaWin32ScreencapMethod_None 0ULL
216#define MaaWin32ScreencapMethod_GDI 1ULL
217#define MaaWin32ScreencapMethod_FramePool (1ULL << 1)
218#define MaaWin32ScreencapMethod_DXGI_DesktopDup (1ULL << 2)
219
220// MaaWin32InputMethod:
224typedef uint64_t MaaWin32InputMethod;
225#define MaaWin32InputMethod_None 0ULL
226#define MaaWin32InputMethod_Seize 1ULL
227#define MaaWin32InputMethod_SendMessage (1ULL << 1)
228
229// MaaDbgControllerType:
233typedef uint64_t MaaDbgControllerType;
234#define MaaDbgControllerType_None 0
235#define MaaDbgControllerType_CarouselImage 1ULL
236#define MaaDbgControllerType_ReplayRecording (1ULL << 1)
237
238typedef struct MaaRect
239{
240 int32_t x;
241 int32_t y;
242 int32_t width;
243 int32_t height;
245
246/*
247 * See MaaMsg.h
248 */
249typedef void(MAA_CALL* MaaNotificationCallback)(const char* message, const char* details_json, void* notify_trans_arg);
250
252 MaaContext* context,
253 MaaTaskId task_id,
254 const char* current_task_name,
255 const char* custom_recognition_name,
256 const char* custom_recognition_param,
257 const MaaImageBuffer* image,
258 const MaaRect* roi,
259 void* trans_arg,
260 /* out */ MaaRect* out_box,
261 /* out */ MaaStringBuffer* out_detail);
262
264 MaaContext* context,
265 MaaTaskId task_id,
266 const char* current_task_name,
267 const char* custom_action_name,
268 const char* custom_action_param,
269 MaaRecoId reco_id,
270 const MaaRect* box,
271 void* trans_arg);
struct MaaImageBuffer MaaImageBuffer
Definition MaaDef.h:31
uint64_t MaaWin32ScreencapMethod
Definition MaaDef.h:214
uint64_t MaaWin32InputMethod
Definition MaaDef.h:224
uint8_t MaaBool
Definition MaaDef.h:18
uint64_t MaaAdbScreencapMethod
Definition MaaDef.h:180
struct MaaStringBuffer MaaStringBuffer
Definition MaaDef.h:30
MaaBool(MAA_CALL * MaaCustomRecognitionCallback)(MaaContext *context, MaaTaskId task_id, const char *current_task_name, const char *custom_recognition_name, const char *custom_recognition_param, const MaaImageBuffer *image, const MaaRect *roi, void *trans_arg, MaaRect *out_box, MaaStringBuffer *out_detail)
Definition MaaDef.h:251
uint64_t MaaOptionValueSize
Definition MaaDef.h:68
MaaBool(MAA_CALL * MaaCustomActionCallback)(MaaContext *context, MaaTaskId task_id, const char *current_task_name, const char *custom_action_name, const char *custom_action_param, MaaRecoId reco_id, const MaaRect *box, void *trans_arg)
Definition MaaDef.h:263
MaaInferenceDeviceEnum
Definition MaaDef.h:114
@ MaaInferenceDevice_Auto
Definition MaaDef.h:116
@ MaaInferenceDevice_GPU1
Definition MaaDef.h:118
@ MaaInferenceDevice_GPU0
Definition MaaDef.h:117
@ MaaInferenceDevice_CPU
Definition MaaDef.h:115
MaaId MaaTaskId
Definition MaaDef.h:25
uint64_t MaaSize
Definition MaaDef.h:19
MaaId MaaRecoId
Definition MaaDef.h:26
struct MaaStringListBuffer MaaStringListBuffer
Definition MaaDef.h:32
int32_t MaaInferenceDevice
Definition MaaDef.h:111
MaaOption MaaGlobalOption
Definition MaaDef.h:70
uint64_t MaaDbgControllerType
Definition MaaDef.h:233
MaaTaskerOptionEnum
Definition MaaDef.h:172
@ MaaTaskerOption_Invalid
Definition MaaDef.h:173
MaaLoggingLevelEnum
Definition MaaDef.h:55
@ MaaLoggingLevel_Debug
Definition MaaDef.h:61
@ MaaLoggingLevel_All
Definition MaaDef.h:63
@ MaaLoggingLevel_Trace
Definition MaaDef.h:62
@ MaaLoggingLevel_Info
Definition MaaDef.h:60
@ MaaLoggingLevel_Off
Definition MaaDef.h:56
@ MaaLoggingLevel_Error
Definition MaaDef.h:58
@ MaaLoggingLevel_Fatal
Definition MaaDef.h:57
@ MaaLoggingLevel_Warn
Definition MaaDef.h:59
void(MAA_CALL * MaaNotificationCallback)(const char *message, const char *details_json, void *notify_trans_arg)
Definition MaaDef.h:249
struct MaaImageListBuffer MaaImageListBuffer
Definition MaaDef.h:33
struct MaaTasker MaaTasker
Definition MaaDef.h:37
MaaStatusEnum
Definition MaaDef.h:43
@ MaaStatus_Running
Definition MaaDef.h:46
@ MaaStatus_Invalid
Definition MaaDef.h:44
@ MaaStatus_Failed
Definition MaaDef.h:48
@ MaaStatus_Succeeded
Definition MaaDef.h:47
@ MaaStatus_Pending
Definition MaaDef.h:45
MaaOption MaaResOption
Definition MaaDef.h:109
int64_t MaaId
Definition MaaDef.h:22
MaaResOptionEnum
Definition MaaDef.h:123
@ MaaResOption_InferenceDevice
Definition MaaDef.h:131
@ MaaResOption_Invalid
Definition MaaDef.h:124
uint64_t MaaAdbInputMethod
Definition MaaDef.h:200
struct MaaController MaaController
Definition MaaDef.h:36
struct MaaResource MaaResource
Definition MaaDef.h:35
void * MaaOptionValue
Definition MaaDef.h:67
int32_t MaaOption
Definition MaaDef.h:66
MaaId MaaResId
Definition MaaDef.h:24
MaaCtrlOptionEnum
Option keys for controller instance options. See MaaControllerSetOption().
Definition MaaDef.h:141
@ MaaCtrlOption_ScreenshotUseRawSize
Definition MaaDef.h:158
@ MaaCtrlOption_Invalid
Definition MaaDef.h:142
@ MaaCtrlOption_ScreenshotTargetShortSide
Definition MaaDef.h:152
@ MaaCtrlOption_ScreenshotTargetLongSide
Definition MaaDef.h:147
@ MaaCtrlOption_Recording
Definition MaaDef.h:166
MaaGlobalOptionEnum
Definition MaaDef.h:73
@ MaaGlobalOption_ShowHitDraw
Definition MaaDef.h:101
@ MaaGlobalOption_StdoutLevel
Definition MaaDef.h:96
@ MaaGlobalOption_DebugMode
Definition MaaDef.h:106
@ MaaGlobalOption_LogDir
Definition MaaDef.h:79
@ MaaGlobalOption_SaveDraw
Definition MaaDef.h:84
@ MaaGlobalOption_Recording
Definition MaaDef.h:90
@ MaaGlobalOption_Invalid
Definition MaaDef.h:74
struct MaaContext MaaContext
Definition MaaDef.h:38
int32_t MaaStatus
Definition MaaDef.h:40
MaaOption MaaTaskerOption
Definition MaaDef.h:169
MaaId MaaCtrlId
Definition MaaDef.h:23
MaaId MaaNodeId
Definition MaaDef.h:27
MaaOption MaaCtrlOption
Definition MaaDef.h:134
int32_t MaaLoggingLevel
Definition MaaDef.h:52
#define MAA_CALL
Definition MaaPort.h:7
Definition MaaDef.h:239
int32_t x
Definition MaaDef.h:240
int32_t width
Definition MaaDef.h:242
int32_t y
Definition MaaDef.h:241
int32_t height
Definition MaaDef.h:243