Maa Framework (main) v2.2.2
A automation black-box testing framework based on image recognition.
Loading...
Searching...
No Matches
MaaDef.h File Reference

The type definitions. More...

#include <stdint.h>
#include "MaaPort.h"

Go to the source code of this file.

Classes

struct  MaaRect
 

Macros

#define MaaNullSize   UINT64_MAX
 
#define MaaInvalidId   ((MaaId)0)
 
#define MaaAdbScreencapMethod_None   0ULL
 
#define MaaAdbScreencapMethod_EncodeToFileAndPull   1ULL
 
#define MaaAdbScreencapMethod_Encode   (1ULL << 1)
 
#define MaaAdbScreencapMethod_RawWithGzip   (1ULL << 2)
 
#define MaaAdbScreencapMethod_RawByNetcat   (1ULL << 3)
 
#define MaaAdbScreencapMethod_MinicapDirect   (1ULL << 4)
 
#define MaaAdbScreencapMethod_MinicapStream   (1ULL << 5)
 
#define MaaAdbScreencapMethod_EmulatorExtras   (1ULL << 6)
 
#define MaaAdbScreencapMethod_All   (~MaaAdbScreencapMethod_None)
 
#define MaaAdbScreencapMethod_Default
 
#define MaaAdbInputMethod_None   0ULL
 
#define MaaAdbInputMethod_AdbShell   1ULL
 
#define MaaAdbInputMethod_MinitouchAndAdbKey   (1ULL << 1)
 
#define MaaAdbInputMethod_Maatouch   (1ULL << 2)
 
#define MaaAdbInputMethod_EmulatorExtras   (1ULL << 3)
 
#define MaaAdbInputMethod_All   (~MaaAdbInputMethod_None)
 
#define MaaAdbInputMethod_Default   (MaaAdbInputMethod_All & (~MaaAdbInputMethod_EmulatorExtras))
 
#define MaaWin32ScreencapMethod_None   0ULL
 
#define MaaWin32ScreencapMethod_GDI   1ULL
 
#define MaaWin32ScreencapMethod_FramePool   (1ULL << 1)
 
#define MaaWin32ScreencapMethod_DXGI_DesktopDup   (1ULL << 2)
 
#define MaaWin32InputMethod_None   0ULL
 
#define MaaWin32InputMethod_Seize   1ULL
 
#define MaaWin32InputMethod_SendMessage   (1ULL << 1)
 
#define MaaDbgControllerType_None   0
 
#define MaaDbgControllerType_CarouselImage   1ULL
 
#define MaaDbgControllerType_ReplayRecording   (1ULL << 1)
 

Typedefs

typedef uint8_t MaaBool
 
typedef uint64_t MaaSize
 
typedef int64_t MaaId
 
typedef MaaId MaaCtrlId
 
typedef MaaId MaaResId
 
typedef MaaId MaaTaskId
 
typedef MaaId MaaRecoId
 
typedef MaaId MaaNodeId
 
typedef struct MaaStringBuffer MaaStringBuffer
 
typedef struct MaaImageBuffer MaaImageBuffer
 
typedef struct MaaStringListBuffer MaaStringListBuffer
 
typedef struct MaaImageListBuffer MaaImageListBuffer
 
typedef struct MaaResource MaaResource
 
typedef struct MaaController MaaController
 
typedef struct MaaTasker MaaTasker
 
typedef struct MaaContext MaaContext
 
typedef int32_t MaaStatus
 
typedef int32_t MaaLoggingLevel
 
typedef int32_t MaaOption
 
typedef void * MaaOptionValue
 
typedef uint64_t MaaOptionValueSize
 
typedef MaaOption MaaGlobalOption
 
typedef MaaOption MaaResOption
 
typedef int32_t MaaInferenceDevice
 
typedef MaaOption MaaCtrlOption
 
typedef MaaOption MaaTaskerOption
 
typedef uint64_t MaaAdbScreencapMethod
 
typedef uint64_t MaaAdbInputMethod
 
typedef uint64_t MaaWin32ScreencapMethod
 
typedef uint64_t MaaWin32InputMethod
 
typedef uint64_t MaaDbgControllerType
 
typedef struct MaaRect MaaRect
 
typedef void(MAA_CALLMaaNotificationCallback) (const char *message, const char *details_json, void *notify_trans_arg)
 
typedef MaaBool(MAA_CALLMaaCustomRecognitionCallback) (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)
 
typedef MaaBool(MAA_CALLMaaCustomActionCallback) (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)
 

Enumerations

enum  MaaStatusEnum {
  MaaStatus_Invalid = 0 ,
  MaaStatus_Pending = 1000 ,
  MaaStatus_Running = 2000 ,
  MaaStatus_Succeeded = 3000 ,
  MaaStatus_Failed = 4000
}
 
enum  MaaLoggingLevelEnum {
  MaaLoggingLevel_Off = 0 ,
  MaaLoggingLevel_Fatal = 1 ,
  MaaLoggingLevel_Error = 2 ,
  MaaLoggingLevel_Warn = 3 ,
  MaaLoggingLevel_Info = 4 ,
  MaaLoggingLevel_Debug = 5 ,
  MaaLoggingLevel_Trace = 6 ,
  MaaLoggingLevel_All = 7
}
 
enum  MaaGlobalOptionEnum {
  MaaGlobalOption_Invalid = 0 ,
  MaaGlobalOption_LogDir = 1 ,
  MaaGlobalOption_SaveDraw = 2 ,
  MaaGlobalOption_Recording = 3 ,
  MaaGlobalOption_StdoutLevel = 4 ,
  MaaGlobalOption_ShowHitDraw = 5 ,
  MaaGlobalOption_DebugMode = 6
}
 
enum  MaaInferenceDeviceEnum {
  MaaInferenceDevice_CPU = -2 ,
  MaaInferenceDevice_Auto = -1 ,
  MaaInferenceDevice_GPU0 = 0 ,
  MaaInferenceDevice_GPU1 = 1
}
 
enum  MaaResOptionEnum {
  MaaResOption_Invalid = 0 ,
  MaaResOption_InferenceDevice = 1
}
 
enum  MaaCtrlOptionEnum {
  MaaCtrlOption_Invalid = 0 ,
  MaaCtrlOption_ScreenshotTargetLongSide = 1 ,
  MaaCtrlOption_ScreenshotTargetShortSide = 2 ,
  MaaCtrlOption_ScreenshotUseRawSize = 3 ,
  MaaCtrlOption_Recording = 5
}
 Option keys for controller instance options. See MaaControllerSetOption(). More...
 
enum  MaaTaskerOptionEnum { MaaTaskerOption_Invalid = 0 }
 

Detailed Description

The type definitions.

Author

Macro Definition Documentation

◆ MaaNullSize

#define MaaNullSize   UINT64_MAX

◆ MaaInvalidId

#define MaaInvalidId   ((MaaId)0)

◆ MaaAdbScreencapMethod_None

#define MaaAdbScreencapMethod_None   0ULL

◆ MaaAdbScreencapMethod_EncodeToFileAndPull

#define MaaAdbScreencapMethod_EncodeToFileAndPull   1ULL

◆ MaaAdbScreencapMethod_Encode

#define MaaAdbScreencapMethod_Encode   (1ULL << 1)

◆ MaaAdbScreencapMethod_RawWithGzip

#define MaaAdbScreencapMethod_RawWithGzip   (1ULL << 2)

◆ MaaAdbScreencapMethod_RawByNetcat

#define MaaAdbScreencapMethod_RawByNetcat   (1ULL << 3)

◆ MaaAdbScreencapMethod_MinicapDirect

#define MaaAdbScreencapMethod_MinicapDirect   (1ULL << 4)

◆ MaaAdbScreencapMethod_MinicapStream

#define MaaAdbScreencapMethod_MinicapStream   (1ULL << 5)

◆ MaaAdbScreencapMethod_EmulatorExtras

#define MaaAdbScreencapMethod_EmulatorExtras   (1ULL << 6)

◆ MaaAdbScreencapMethod_All

#define MaaAdbScreencapMethod_All   (~MaaAdbScreencapMethod_None)

◆ MaaAdbScreencapMethod_Default

#define MaaAdbScreencapMethod_Default
Value:
(MaaAdbScreencapMethod_All & (~MaaAdbScreencapMethod_RawByNetcat) & (~MaaAdbScreencapMethod_MinicapDirect) \
& (~MaaAdbScreencapMethod_MinicapStream))
#define MaaAdbScreencapMethod_All
Definition MaaDef.h:190
#define MaaAdbScreencapMethod_MinicapDirect
Definition MaaDef.h:186

◆ MaaAdbInputMethod_None

#define MaaAdbInputMethod_None   0ULL

◆ MaaAdbInputMethod_AdbShell

#define MaaAdbInputMethod_AdbShell   1ULL

◆ MaaAdbInputMethod_MinitouchAndAdbKey

#define MaaAdbInputMethod_MinitouchAndAdbKey   (1ULL << 1)

◆ MaaAdbInputMethod_Maatouch

#define MaaAdbInputMethod_Maatouch   (1ULL << 2)

◆ MaaAdbInputMethod_EmulatorExtras

#define MaaAdbInputMethod_EmulatorExtras   (1ULL << 3)

◆ MaaAdbInputMethod_All

#define MaaAdbInputMethod_All   (~MaaAdbInputMethod_None)

◆ MaaAdbInputMethod_Default

#define MaaAdbInputMethod_Default   (MaaAdbInputMethod_All & (~MaaAdbInputMethod_EmulatorExtras))

◆ MaaWin32ScreencapMethod_None

#define MaaWin32ScreencapMethod_None   0ULL

◆ MaaWin32ScreencapMethod_GDI

#define MaaWin32ScreencapMethod_GDI   1ULL

◆ MaaWin32ScreencapMethod_FramePool

#define MaaWin32ScreencapMethod_FramePool   (1ULL << 1)

◆ MaaWin32ScreencapMethod_DXGI_DesktopDup

#define MaaWin32ScreencapMethod_DXGI_DesktopDup   (1ULL << 2)

◆ MaaWin32InputMethod_None

#define MaaWin32InputMethod_None   0ULL

◆ MaaWin32InputMethod_Seize

#define MaaWin32InputMethod_Seize   1ULL

◆ MaaWin32InputMethod_SendMessage

#define MaaWin32InputMethod_SendMessage   (1ULL << 1)

◆ MaaDbgControllerType_None

#define MaaDbgControllerType_None   0

◆ MaaDbgControllerType_CarouselImage

#define MaaDbgControllerType_CarouselImage   1ULL

◆ MaaDbgControllerType_ReplayRecording

#define MaaDbgControllerType_ReplayRecording   (1ULL << 1)

Typedef Documentation

◆ MaaBool

typedef uint8_t MaaBool

◆ MaaSize

typedef uint64_t MaaSize

◆ MaaId

typedef int64_t MaaId

◆ MaaCtrlId

typedef MaaId MaaCtrlId

◆ MaaResId

typedef MaaId MaaResId

◆ MaaTaskId

typedef MaaId MaaTaskId

◆ MaaRecoId

typedef MaaId MaaRecoId

◆ MaaNodeId

typedef MaaId MaaNodeId

◆ MaaStringBuffer

◆ MaaImageBuffer

◆ MaaStringListBuffer

◆ MaaImageListBuffer

◆ MaaResource

typedef struct MaaResource MaaResource

◆ MaaController

typedef struct MaaController MaaController

◆ MaaTasker

typedef struct MaaTasker MaaTasker

◆ MaaContext

typedef struct MaaContext MaaContext

◆ MaaStatus

typedef int32_t MaaStatus

◆ MaaLoggingLevel

typedef int32_t MaaLoggingLevel

◆ MaaOption

typedef int32_t MaaOption

◆ MaaOptionValue

typedef void* MaaOptionValue

◆ MaaOptionValueSize

typedef uint64_t MaaOptionValueSize

◆ MaaGlobalOption

◆ MaaResOption

◆ MaaInferenceDevice

typedef int32_t MaaInferenceDevice

◆ MaaCtrlOption

◆ MaaTaskerOption

◆ MaaAdbScreencapMethod

typedef uint64_t MaaAdbScreencapMethod

Use bitwise OR to set the method you need, MaaFramework will test their speed and use the fastest one.

◆ MaaAdbInputMethod

typedef uint64_t MaaAdbInputMethod

Use bitwise OR to set the method you need, MaaFramework will select the available ones according to priority. The priority is: EmulatorExtras > Maatouch > MinitouchAndAdbKey > AdbShell

◆ MaaWin32ScreencapMethod

typedef uint64_t MaaWin32ScreencapMethod

No bitwise OR, just set it

◆ MaaWin32InputMethod

typedef uint64_t MaaWin32InputMethod

No bitwise OR, just set it

◆ MaaDbgControllerType

typedef uint64_t MaaDbgControllerType

No bitwise OR, just set it

◆ MaaRect

typedef struct MaaRect MaaRect

◆ MaaNotificationCallback

typedef void(MAA_CALL * MaaNotificationCallback) (const char *message, const char *details_json, void *notify_trans_arg)

◆ MaaCustomRecognitionCallback

typedef 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)

◆ MaaCustomActionCallback

typedef 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)

Enumeration Type Documentation

◆ MaaStatusEnum

Enumerator
MaaStatus_Invalid 
MaaStatus_Pending 
MaaStatus_Running 
MaaStatus_Succeeded 
MaaStatus_Failed 

◆ MaaLoggingLevelEnum

Enumerator
MaaLoggingLevel_Off 
MaaLoggingLevel_Fatal 
MaaLoggingLevel_Error 
MaaLoggingLevel_Warn 
MaaLoggingLevel_Info 
MaaLoggingLevel_Debug 
MaaLoggingLevel_Trace 
MaaLoggingLevel_All 

◆ MaaGlobalOptionEnum

Enumerator
MaaGlobalOption_Invalid 
MaaGlobalOption_LogDir 

Log dir

value: string, eg: "C:\\Users\\Administrator\\Desktop\\log"; val_size: string length 
MaaGlobalOption_SaveDraw 

Whether to save draw

value: bool, eg: true; val_size: sizeof(bool) 
MaaGlobalOption_Recording 

Dump all screenshots and actions

Recording will evaluate to true if any of this or MaaCtrlOptionEnum::MaaCtrlOption_Recording is true.
value: bool, eg: true; val_size: sizeof(bool) 
MaaGlobalOption_StdoutLevel 

The level of log output to stdout

value: MaaLoggingLevel, val_size: sizeof(MaaLoggingLevel)
default value is MaaLoggingLevel_Error 
MaaGlobalOption_ShowHitDraw 

Whether to show hit draw

value: bool, eg: true; val_size: sizeof(bool) 
MaaGlobalOption_DebugMode 

Whether to debug

value: bool, eg: true; val_size: sizeof(bool) 

◆ MaaInferenceDeviceEnum

Enumerator
MaaInferenceDevice_CPU 
MaaInferenceDevice_Auto 
MaaInferenceDevice_GPU0 
MaaInferenceDevice_GPU1 

◆ MaaResOptionEnum

Enumerator
MaaResOption_Invalid 
MaaResOption_InferenceDevice 

Use the specified inference device. Please set this option before loading the model.

value: MaaInferenceDevice, eg: 0; val_size: sizeof(MaaInferenceDevice) default value is MaaInferenceDevice_Auto

◆ MaaCtrlOptionEnum

Option keys for controller instance options. See MaaControllerSetOption().

Enumerator
MaaCtrlOption_Invalid 
MaaCtrlOption_ScreenshotTargetLongSide 

Only one of long and short side can be set, and the other is automatically scaled according to the aspect ratio.

value: int, eg: 1280; val_size: sizeof(int) 
MaaCtrlOption_ScreenshotTargetShortSide 

Only one of long and short side can be set, and the other is automatically scaled according to the aspect ratio.

value: int, eg: 720; val_size: sizeof(int) 
MaaCtrlOption_ScreenshotUseRawSize 

Screenshot use raw size without scaling. Please note that this option may cause incorrect coordinates on user devices with different resolutions if scaling is not performed.

value: bool, eg: true; val_size: sizeof(bool)

MaaCtrlOption_Recording 

Dump all screenshots and actions

Recording will evaluate to true if any of this or
MaaGlobalOptionEnum::MaaGlobalOption_Recording is true.

value: bool, eg: true; val_size: sizeof(bool) 

◆ MaaTaskerOptionEnum

Enumerator
MaaTaskerOption_Invalid