diff --git a/include/MaaFramework/Instance/MaaController.h b/include/MaaFramework/Instance/MaaController.h index 6f776839a..e9e9e8592 100644 --- a/include/MaaFramework/Instance/MaaController.h +++ b/include/MaaFramework/Instance/MaaController.h @@ -1,7 +1,8 @@ /** * @file MaaController.h * @author - * @brief The controller interface. See \ref MaaControllerPostRequest for details on how to post requests to the controller. + * @brief The controller interface. See \ref MaaControllerPostRequest for details on how to post requests to the + * controller. * * @copyright Copyright (c) 2024 * @@ -36,8 +37,9 @@ extern "C" /** * @brief Create a win32 controller instance. - * - * @param hWnd The win32 window handle to control. This can be retrieved by helpers provided in MaaToolkitWin32Window.h. + * + * @param hWnd The win32 window handle to control. This can be retrieved by helpers provided in + * MaaToolkitWin32Window.h. * @param type The type of the win32 controller. See #MaaWin32ControllerTypeEnum. * @param callback The callback function. See ::MaaAPICallback. * @param callback_arg The callback arg that will be passed to the callback function. @@ -86,7 +88,7 @@ extern "C" /** * @brief Free the controller instance. - * + * * @param ctrl */ void MAA_FRAMEWORK_API MaaControllerDestroy(MaaControllerHandle ctrl); @@ -94,7 +96,8 @@ extern "C" /** * @brief Set options for a given controller instance. * - * This function requires a given set of option keys and value types, otherwise this will fail. See #MaaCtrlOptionEnum for details. + * This function requires a given set of option keys and value types, otherwise this will fail. See + * #MaaCtrlOptionEnum for details. * * @param ctrl The handle of the controller instance to set options for. * @param key The option key. @@ -145,18 +148,18 @@ extern "C" /** * @brief Wait for the request identified by the given id to complete. - * - * @param ctrl - * @param id + * + * @param ctrl + * @param id * @return MaaStatus The status of the request. */ MaaStatus MAA_FRAMEWORK_API MaaControllerWait(MaaControllerHandle ctrl, MaaCtrlId id); /** * @brief Check if the controller is connected. - * - * @param ctrl - * @return MaaBool + * + * @param ctrl + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaControllerConnected(MaaControllerHandle ctrl); diff --git a/include/MaaFramework/Instance/MaaCustomController.h b/include/MaaFramework/Instance/MaaCustomController.h index ecdb852ff..527641665 100644 --- a/include/MaaFramework/Instance/MaaCustomController.h +++ b/include/MaaFramework/Instance/MaaCustomController.h @@ -4,7 +4,7 @@ * @brief Custom controller API. * * @copyright Copyright (c) 2024 - * + * */ #pragma once diff --git a/include/MaaFramework/Instance/MaaInstance.h b/include/MaaFramework/Instance/MaaInstance.h index 8c474e219..1396b6b78 100644 --- a/include/MaaFramework/Instance/MaaInstance.h +++ b/include/MaaFramework/Instance/MaaInstance.h @@ -4,7 +4,7 @@ * @brief The instance API. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -22,21 +22,22 @@ extern "C" * * @param callback The callback function. See MaaAPICallback * @param callback_arg The callback arg that will be passed to the callback function. - * @return MaaInstanceHandle + * @return MaaInstanceHandle */ MaaInstanceHandle MAA_FRAMEWORK_API MaaCreate(MaaInstanceCallback callback, MaaCallbackTransparentArg callback_arg); /** * @brief Free the instance. - * - * @param inst + * + * @param inst */ void MAA_FRAMEWORK_API MaaDestroy(MaaInstanceHandle inst); /** * @brief Set options for a given instance. * - * This function requires a given set of option keys and value types, otherwise this will fail. See #MaaInstOptionEnum for details. + * This function requires a given set of option keys and value types, otherwise this will fail. See + * #MaaInstOptionEnum for details. * * @param inst The handle of the instance to set options for. * @param key The option key. @@ -54,7 +55,7 @@ extern "C" * * @param inst * @param res - * @return MaaBool + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaBindResource(MaaInstanceHandle inst, MaaResourceHandle res); @@ -64,16 +65,16 @@ extern "C" * See functions in MaaController.h about how to create a controller. * * @param inst - * @param ctrl - * @return MaaBool + * @param ctrl + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaBindController(MaaInstanceHandle inst, MaaControllerHandle ctrl); /** * @brief Check if the instance is initialized. - * - * @param inst - * @return MaaBool + * + * @param inst + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaInited(MaaInstanceHandle inst); @@ -82,10 +83,10 @@ extern "C" * * See MaaCustomRecognizer.h for details about how to create a custom recognizer. * - * @param inst + * @param inst * @param name The name of the recognizer that will be used to reference it. - * @param recognizer - * @param recognizer_arg + * @param recognizer + * @param recognizer_arg * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaRegisterCustomRecognizer(MaaInstanceHandle inst, MaaStringView name, @@ -95,17 +96,17 @@ extern "C" /** * @brief Unregister a custom recognizer from the instance. * - * @param inst + * @param inst * @param name The name of the recognizer when it was registered. - * @return MaaBool + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaUnregisterCustomRecognizer(MaaInstanceHandle inst, MaaStringView name); /** * @brief Clear all custom recognizers registered to the instance. - * - * @param inst - * @return MaaBool + * + * @param inst + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaClearCustomRecognizer(MaaInstanceHandle inst); @@ -116,9 +117,9 @@ extern "C" * * @param inst * @param name The name of the action that will be used to reference it. - * @param action - * @param action_arg - * @return MaaBool + * @param action + * @param action_arg + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaRegisterCustomAction(MaaInstanceHandle inst, MaaStringView name, MaaCustomActionHandle action, MaaTransparentArg action_arg); @@ -128,15 +129,15 @@ extern "C" * * @param inst * @param name The name of the action when it was registered. - * @return MaaBool + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaUnregisterCustomAction(MaaInstanceHandle inst, MaaStringView name); /** * @brief Clear all custom actions registered to the instance. - * - * @param inst - * @return MaaBool + * + * @param inst + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaClearCustomAction(MaaInstanceHandle inst); @@ -161,33 +162,33 @@ extern "C" * @param inst * @param id The id of the task. * @param param The parameter of the task. - * @return MaaBool + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaSetTaskParam(MaaInstanceHandle inst, MaaTaskId id, MaaStringView param); /** * @brief Get the status of a task identified by the id. - * - * @param inst - * @param id - * @return MaaStatus + * + * @param inst + * @param id + * @return MaaStatus */ MaaStatus MAA_FRAMEWORK_API MaaTaskStatus(MaaInstanceHandle inst, MaaTaskId id); /** * @brief Wait for a task to finish. - * - * @param inst - * @param id - * @return MaaStatus + * + * @param inst + * @param id + * @return MaaStatus */ MaaStatus MAA_FRAMEWORK_API MaaWaitTask(MaaInstanceHandle inst, MaaTaskId id); /** * @brief Wait for all tasks to finish. - * - * @param inst - * @return MaaBool + * + * @param inst + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaTaskAllFinished(MaaInstanceHandle inst); @@ -195,9 +196,9 @@ extern "C" * @brief Post a stop signal to the instance. * * This immediately stops the instance and all its tasks. - * - * @param inst - * @return MaaBool + * + * @param inst + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaPostStop(MaaInstanceHandle inst); @@ -207,16 +208,16 @@ extern "C" /** * @brief Get the resource handle of the instance. * - * @param inst - * @return MaaResourceHandle + * @param inst + * @return MaaResourceHandle */ MaaResourceHandle MAA_FRAMEWORK_API MaaGetResource(MaaInstanceHandle inst); /** * @brief Get the controller handle of the instance. - * - * @param inst - * @return MaaControllerHandle + * + * @param inst + * @return MaaControllerHandle */ MaaControllerHandle MAA_FRAMEWORK_API MaaGetController(MaaInstanceHandle inst); diff --git a/include/MaaFramework/Instance/MaaResource.h b/include/MaaFramework/Instance/MaaResource.h index 260347a3b..44d2184ff 100644 --- a/include/MaaFramework/Instance/MaaResource.h +++ b/include/MaaFramework/Instance/MaaResource.h @@ -4,7 +4,7 @@ * @brief The resource API. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -19,18 +19,18 @@ extern "C" /** * @brief Create a resource. - * + * * @param callback The callback function. See MaaAPICallback - * @param callback_arg - * @return MaaResourceHandle + * @param callback_arg + * @return MaaResourceHandle */ MaaResourceHandle MAA_FRAMEWORK_API MaaResourceCreate(MaaResourceCallback callback, MaaCallbackTransparentArg callback_arg); /** * @brief Free the resource. - * - * @param res + * + * @param res */ void MAA_FRAMEWORK_API MaaResourceDestroy(MaaResourceHandle res); @@ -45,34 +45,35 @@ extern "C" /** * @brief Get the loading status of a resource identified by id. - * - * @param res - * @param id - * @return MaaStatus + * + * @param res + * @param id + * @return MaaStatus */ MaaStatus MAA_FRAMEWORK_API MaaResourceStatus(MaaResourceHandle res, MaaResId id); /** * @brief Wait for a resource to be loaded. - * - * @param res - * @param id - * @return MaaStatus + * + * @param res + * @param id + * @return MaaStatus */ MaaStatus MAA_FRAMEWORK_API MaaResourceWait(MaaResourceHandle res, MaaResId id); /** * @brief Check if resources are loaded. - * - * @param res - * @return MaaBool + * + * @param res + * @return MaaBool */ MaaBool MAA_FRAMEWORK_API MaaResourceLoaded(MaaResourceHandle res); /** * @brief Set options for a given resource. * - * This function requires a given set of option keys and value types, otherwise this will fail. See #MaaResOptionEnum for details. + * This function requires a given set of option keys and value types, otherwise this will fail. See + * #MaaResOptionEnum for details. * * @param res The handle of the resource to set options for. * @param key The option key. diff --git a/include/MaaFramework/MaaAPI.h b/include/MaaFramework/MaaAPI.h index 45fd77ef7..994e0c9d7 100644 --- a/include/MaaFramework/MaaAPI.h +++ b/include/MaaFramework/MaaAPI.h @@ -19,7 +19,8 @@ * * @section intro_sec Introduction * - * MaaFramework is a toolset used to create automated tests under various environments such as Windows and Andoroid emulators. + * MaaFramework is a toolset used to create automated tests under various environments such as Windows and Andoroid + * emulators. * * For starter, take a look at the following pages: * @@ -27,5 +28,5 @@ * - MaaController.h * - MaaResource.h * - MaaToolkitDevice.h - * - */ \ No newline at end of file + * + */ diff --git a/include/MaaFramework/MaaDef.h b/include/MaaFramework/MaaDef.h index d73f1f355..284b4f3e3 100644 --- a/include/MaaFramework/MaaDef.h +++ b/include/MaaFramework/MaaDef.h @@ -4,7 +4,7 @@ * @brief The type definitions. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -106,7 +106,7 @@ typedef MaaOption MaaCtrlOption; /** * @brief Option keys for controller instance options. See MaaControllerSetOption(). - * + * */ enum MaaCtrlOptionEnum { diff --git a/include/MaaFramework/MaaMsg.h b/include/MaaFramework/MaaMsg.h index 10997eee4..8d0b046e0 100644 --- a/include/MaaFramework/MaaMsg.h +++ b/include/MaaFramework/MaaMsg.h @@ -3,10 +3,11 @@ * @author * @brief Contains the callback message definitions. * - * A callback consists of a message and a payload. The message is a string that indicates the type of the message. The payload is a JSON object that contains the details of the message. + * A callback consists of a message and a payload. The message is a string that indicates the type of the message. The + * payload is a JSON object that contains the details of the message. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -65,7 +66,7 @@ * height: number * } * } - * + * */ #define MaaMsg_Controller_ResolutionGot ("Controller.ResolutionGot") @@ -97,7 +98,7 @@ * payload: { * why: string * } - * + * */ #define MaaMsg_Controller_ConnectFailed ("Controller.ConnectFailed") @@ -153,4 +154,4 @@ #define MaaMsg_Task_Focus_Runout ("Task.Focus.Runout") #define MaaMsg_Task_Focus_Completed ("Task.Focus.Completed") /// @} -/** @} */ \ No newline at end of file +/** @} */ diff --git a/include/MaaFramework/Task/MaaCustomAction.h b/include/MaaFramework/Task/MaaCustomAction.h index b4c419311..fc4bd3b33 100644 --- a/include/MaaFramework/Task/MaaCustomAction.h +++ b/include/MaaFramework/Task/MaaCustomAction.h @@ -2,9 +2,9 @@ * @file MaaCustomAction.h * @author * @brief Custom action API. - * + * * @copyright Copyright (c) 2024 - * + * */ #pragma once diff --git a/include/MaaFramework/Task/MaaCustomRecognizer.h b/include/MaaFramework/Task/MaaCustomRecognizer.h index 3f8a4a92c..148d82279 100644 --- a/include/MaaFramework/Task/MaaCustomRecognizer.h +++ b/include/MaaFramework/Task/MaaCustomRecognizer.h @@ -4,7 +4,7 @@ * @brief Custom recognizer API. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -27,7 +27,6 @@ extern "C" */ struct MaaCustomRecognizerAPI { - /// Write the recognition result to the out_box and return true if the recognition is successful. /// If the recognition fails, return false. /// You can also write details to the out_detail buffer. diff --git a/include/MaaFramework/Utility/MaaBuffer.h b/include/MaaFramework/Utility/MaaBuffer.h index 2d25ccbb9..7d148b896 100644 --- a/include/MaaFramework/Utility/MaaBuffer.h +++ b/include/MaaFramework/Utility/MaaBuffer.h @@ -4,7 +4,7 @@ * @brief Provide helpers funtions to manage, read and edit buffers. * * @copyright Copyright (c) 2024 - * + * */ #pragma once diff --git a/include/MaaFramework/Utility/MaaUtility.h b/include/MaaFramework/Utility/MaaUtility.h index 6b76e5d04..f724a128c 100644 --- a/include/MaaFramework/Utility/MaaUtility.h +++ b/include/MaaFramework/Utility/MaaUtility.h @@ -4,7 +4,7 @@ * @brief Provide global functions for the framework. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -19,15 +19,16 @@ extern "C" /** * @brief Get the version of the framework. - * - * @return MaaStringView + * + * @return MaaStringView */ MaaStringView MAA_FRAMEWORK_API MaaVersion(); /** * @brief Set options globally. * - * This function requires a given set of option keys and value types, otherwise this will fail. See #MaaGlobalOptionEnum for details. + * This function requires a given set of option keys and value types, otherwise this will fail. See + * #MaaGlobalOptionEnum for details. * * @param key The option key. * @param value The option value. diff --git a/include/MaaToolkit/Config/MaaToolkitConfig.h b/include/MaaToolkit/Config/MaaToolkitConfig.h index 0c3556f15..9ae9ef885 100644 --- a/include/MaaToolkit/Config/MaaToolkitConfig.h +++ b/include/MaaToolkit/Config/MaaToolkitConfig.h @@ -4,7 +4,7 @@ * @brief Init and uninit the toolkit. * * @copyright Copyright (c) 2024 - * + * */ #pragma once diff --git a/include/MaaToolkit/Device/MaaToolkitDevice.h b/include/MaaToolkit/Device/MaaToolkitDevice.h index 732cebbae..d882d848b 100644 --- a/include/MaaToolkit/Device/MaaToolkitDevice.h +++ b/include/MaaToolkit/Device/MaaToolkitDevice.h @@ -4,7 +4,7 @@ * @brief Toolkits for working with ADB controller. * * @copyright Copyright (c) 2024 - * + * */ #pragma once @@ -20,8 +20,8 @@ extern "C" * @brief Find ADB devices. * * \deprecated Use MaaToolkitPostFindDevice() instead. - * - * @return MaaSize + * + * @return MaaSize */ MaaSize MAA_TOOLKIT_API MaaToolkitFindDevice(); @@ -30,8 +30,8 @@ extern "C" * * \deprecated Use MaaToolkitPostFindDeviceWithAdb() instead. * - * @param adb_path - * @return MaaSize + * @param adb_path + * @return MaaSize */ MaaSize MAA_TOOLKIT_API MaaToolkitFindDeviceWithAdb(MaaStringView adb_path); @@ -44,22 +44,22 @@ extern "C" /** * @brief Post a request to find all ADB devices with a given ADB path. - * - * @param adb_path - * @return MaaBool + * + * @param adb_path + * @return MaaBool */ MaaBool MAA_TOOLKIT_API MaaToolkitPostFindDeviceWithAdb(MaaStringView adb_path); /** * @brief Check if the find device request is completed. - * - * @return MaaBool + * + * @return MaaBool */ MaaBool MAA_TOOLKIT_API MaaToolkitIsFindDeviceCompleted(); /** * @brief Wait for the find device request to complete. - * + * * @return MaaSize The number of devices found. */ MaaSize MAA_TOOLKIT_API MaaToolkitWaitForFindDeviceToComplete(); @@ -74,7 +74,8 @@ extern "C" /** * @brief Get the device name by index. * - * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise out_of_range exception will be thrown. + * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise + * out_of_range exception will be thrown. * @return MaaStringView */ MaaStringView MAA_TOOLKIT_API MaaToolkitGetDeviceName(MaaSize index); @@ -82,32 +83,36 @@ extern "C" /** * @brief Get the device ADB path by index. * - * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise out_of_range exception will be thrown. - * @return MaaStringView + * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise + * out_of_range exception will be thrown. + * @return MaaStringView */ MaaStringView MAA_TOOLKIT_API MaaToolkitGetDeviceAdbPath(MaaSize index); /** * @brief Get the device ADB serial by index. * - * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise out_of_range exception will be thrown. - * @return MaaStringView + * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise + * out_of_range exception will be thrown. + * @return MaaStringView */ MaaStringView MAA_TOOLKIT_API MaaToolkitGetDeviceAdbSerial(MaaSize index); /** * @brief Get the device ADB controller type by index. * - * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise out_of_range exception will be thrown. - * @return MaaAdbControllerType + * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise + * out_of_range exception will be thrown. + * @return MaaAdbControllerType */ MaaAdbControllerType MAA_TOOLKIT_API MaaToolkitGetDeviceAdbControllerType(MaaSize index); /** * @brief Get the device ADB config by index. * - * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise out_of_range exception will be thrown. - * @return MaaStringView + * @param index The 0-based index of the device. The index should not exceed the number of devices found otherwise + * out_of_range exception will be thrown. + * @return MaaStringView */ MaaStringView MAA_TOOLKIT_API MaaToolkitGetDeviceAdbConfig(MaaSize index); diff --git a/include/MaaToolkit/Win32/MaaToolkitWin32Window.h b/include/MaaToolkit/Win32/MaaToolkitWin32Window.h index dedd2201e..a501dc266 100644 --- a/include/MaaToolkit/Win32/MaaToolkitWin32Window.h +++ b/include/MaaToolkit/Win32/MaaToolkitWin32Window.h @@ -14,7 +14,8 @@ extern "C" * * @param class_name The class name of the window. If passed an empty string, class name will not be filtered. * @param window_name The window name of the window. If passed an empty string, window name will not be filtered. - * @return MaaSize The number of windows found that match the criteria. To get the corresponding window handle, use MaaToolkitGetWindow(). + * @return MaaSize The number of windows found that match the criteria. To get the corresponding window handle, use + * MaaToolkitGetWindow(). */ MaaSize MAA_TOOLKIT_API MaaToolkitFindWindow(MaaStringView class_name, MaaStringView window_name); @@ -24,15 +25,17 @@ extern "C" * This function searches the function by substring match. See also MaaToolkitFindWindow(). * * @param class_name The class name of the window. If passed an empty string, class name will not be filtered. - * @param window_name The window name of the window. If passed an empty string, window name will not be filtered. - * @return MaaSize The number of windows found that match the criteria. To get the corresponding window handle, use MaaToolkitGetWindow(). - */ + * @param window_name The window name of the window. If passed an empty string, window name will not be filtered. + * @return MaaSize The number of windows found that match the criteria. To get the corresponding window handle, use + * MaaToolkitGetWindow(). + */ MaaSize MAA_TOOLKIT_API MaaToolkitSearchWindow(MaaStringView class_name, MaaStringView window_name); /** * @brief Get the window handle by index. - * - * @param index The 0-based index of the window. The index should not exceed the number of windows found otherwise out_of_range exception will be thrown. + * + * @param index The 0-based index of the window. The index should not exceed the number of windows found otherwise + * out_of_range exception will be thrown. * @return MaaWin32Hwnd The window handle. */ MaaWin32Hwnd MAA_TOOLKIT_API MaaToolkitGetWindow(MaaSize index); diff --git a/source/MaaUtils/Codec/Codec.cpp b/source/MaaUtils/Codec/Codec.cpp index f49325cf1..cf82c811b 100644 --- a/source/MaaUtils/Codec/Codec.cpp +++ b/source/MaaUtils/Codec/Codec.cpp @@ -27,7 +27,7 @@ std::string from_u16(const std::wstring& u16str) } #if defined(__clang__) -#pragma clang diagnostic pop // -Wdeprecated-declarations +#pragma clang diagnostic pop // -Wdeprecated-declarations #endif MAA_NS_END diff --git a/source/MaaUtils/Runtime/Runtime_Posix.cpp b/source/MaaUtils/Runtime/Runtime_Posix.cpp index 977c396ad..27e107a46 100644 --- a/source/MaaUtils/Runtime/Runtime_Posix.cpp +++ b/source/MaaUtils/Runtime/Runtime_Posix.cpp @@ -22,7 +22,7 @@ const std::filesystem::path& library_dir() void init_library_dir() { - Dl_info dl_info{}; + Dl_info dl_info {}; if (dladdr((void*)init_library_dir, &dl_info) == 0) { return; }