Maa Framework (main) v2.2.0-beta.3
A automation black-box testing framework based on image recognition.
Loading...
Searching...
No Matches
MaaController.h
Go to the documentation of this file.
1
10// IWYU pragma: private, include <MaaFramework/MaaAPI.h>
11
12#pragma once
13
14#include "../MaaDef.h"
15#include "../MaaPort.h"
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
23
25 const char* adb_path,
26 const char* address,
27 MaaAdbScreencapMethod screencap_methods,
28 MaaAdbInputMethod input_methods,
29 const char* config,
30 const char* agent_path,
32 void* notify_trans_arg);
33
35 void* hWnd,
36 MaaWin32ScreencapMethod screencap_method,
37 MaaWin32InputMethod input_method,
39 void* notify_trans_arg);
40
43 void* controller_arg,
45 void* notify_trans_arg);
46
48 const char* read_path,
49 const char* write_path,
51 const char* config,
53 void* notify_trans_arg);
54
56
61 MaaController* ctrl,
62 MaaCtrlOption key,
63 MaaOptionValue value ,
64 MaaOptionValueSize val_size);
65
67
69
71 MaaControllerPostSwipe(MaaController* ctrl, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t duration);
72
74
76
78
80
81 // for adb controller, contact means finger id (0 for first finger, 1 for second finger, etc)
82 // for win32 controller, contact means mouse button id (0 for left, 1 for right, 2 for middle)
83 MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostTouchDown(MaaController* ctrl, int32_t contact, int32_t x, int32_t y, int32_t pressure);
84
85 MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostTouchMove(MaaController* ctrl, int32_t contact, int32_t x, int32_t y, int32_t pressure);
86
87 // for adb controller, contact means finger id (0 for first finger, 1 for second finger, etc)
88 // for win32 controller, contact means mouse button id (0 for left, 1 for right, 2 for middle)
90
92
94
96
98
100
102
103#ifdef __cplusplus
104}
105#endif
MAA_FRAMEWORK_API MaaBool MaaControllerConnected(const MaaController *ctrl)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostConnection(MaaController *ctrl)
MAA_FRAMEWORK_API MaaBool MaaControllerGetUuid(MaaController *ctrl, MaaStringBuffer *buffer)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostTouchUp(MaaController *ctrl, int32_t contact)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostStopApp(MaaController *ctrl, const char *intent)
MAA_FRAMEWORK_API MaaController * MaaDbgControllerCreate(const char *read_path, const char *write_path, MaaDbgControllerType type, const char *config, MaaNotificationCallback notify, void *notify_trans_arg)
MAA_FRAMEWORK_API void MaaControllerDestroy(MaaController *ctrl)
MAA_FRAMEWORK_API MaaStatus MaaControllerWait(const MaaController *ctrl, MaaCtrlId id)
MAA_FRAMEWORK_API MaaBool MaaControllerCachedImage(const MaaController *ctrl, MaaImageBuffer *buffer)
MAA_FRAMEWORK_API MaaController * MaaAdbControllerCreate(const char *adb_path, const char *address, MaaAdbScreencapMethod screencap_methods, MaaAdbInputMethod input_methods, const char *config, const char *agent_path, MaaNotificationCallback notify, void *notify_trans_arg)
MAA_FRAMEWORK_API MaaController * MaaWin32ControllerCreate(void *hWnd, MaaWin32ScreencapMethod screencap_method, MaaWin32InputMethod input_method, MaaNotificationCallback notify, void *notify_trans_arg)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostTouchMove(MaaController *ctrl, int32_t contact, int32_t x, int32_t y, int32_t pressure)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostStartApp(MaaController *ctrl, const char *intent)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostClick(MaaController *ctrl, int32_t x, int32_t y)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostSwipe(MaaController *ctrl, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t duration)
MAA_FRAMEWORK_API MaaBool MaaControllerSetOption(MaaController *ctrl, MaaCtrlOption key, MaaOptionValue value, MaaOptionValueSize val_size)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostInputText(MaaController *ctrl, const char *text)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostTouchDown(MaaController *ctrl, int32_t contact, int32_t x, int32_t y, int32_t pressure)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostScreencap(MaaController *ctrl)
MAA_FRAMEWORK_API MaaCtrlId MaaControllerPostPressKey(MaaController *ctrl, int32_t keycode)
MAA_FRAMEWORK_API MaaController * MaaCustomControllerCreate(MaaCustomControllerCallbacks *controller, void *controller_arg, MaaNotificationCallback notify, void *notify_trans_arg)
MAA_FRAMEWORK_API MaaStatus MaaControllerStatus(const MaaController *ctrl, MaaCtrlId id)
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
uint64_t MaaOptionValueSize
Definition MaaDef.h:68
uint64_t MaaDbgControllerType
Definition MaaDef.h:233
void(MAA_CALL * MaaNotificationCallback)(const char *message, const char *details_json, void *notify_trans_arg)
Definition MaaDef.h:249
uint64_t MaaAdbInputMethod
Definition MaaDef.h:200
struct MaaController MaaController
Definition MaaDef.h:36
void * MaaOptionValue
Definition MaaDef.h:67
int32_t MaaStatus
Definition MaaDef.h:40
MaaId MaaCtrlId
Definition MaaDef.h:23
MaaOption MaaCtrlOption
Definition MaaDef.h:134
#define MAA_FRAMEWORK_API
Definition MaaPort.h:36
The custom controller API.
Definition MaaCustomController.h:32