| 76 | } |
| 77 | |
| 78 | MaaController* 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 | |
| 100 | MaaController* MaaAndroidNativeControllerCreate(const char* config_json) |
| 101 | { |
no test coverage detected