MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / MaaMacOSControllerCreate

Function MaaMacOSControllerCreate

source/MaaFramework/API/MaaFramework.cpp:78–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78MaaController* MaaMacOSControllerCreate(uint32_t window_id, MaaMacOSScreencapMethod screencap_method, MaaMacOSInputMethod input_method)
79{
80 LogFunc << VAR(window_id) << VAR(screencap_method) << VAR(input_method);
81
82#ifndef __APPLE__
83
84 LogError << "This API " << __FUNCTION__ << " is only available on macOS";
85 return nullptr;
86
87#else
88
89 auto control_unit = MAA_NS::MacOSControlUnitLibraryHolder::create_control_unit(window_id, screencap_method, input_method);
90
91 if (!control_unit) {
92 LogError << "Failed to create control unit";
93 return nullptr;
94 }
95
96 return new MAA_CTRL_NS::ControllerAgent(std::move(control_unit));
97#endif
98}
99
100MaaController* MaaAndroidNativeControllerCreate(const char* config_json)
101{

Callers 4

create_macos_controllerFunction · 0.50
ctorMethod · 0.50
runMethod · 0.50
runMaaTestFunction · 0.50

Calls 1

moveFunction · 0.85

Tested by

no test coverage detected