Skip to content

Commit

Permalink
styles: format
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Feb 28, 2024
1 parent 63333be commit 18bde82
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 124 deletions.
25 changes: 14 additions & 11 deletions include/MaaFramework/Instance/MaaController.h
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -86,15 +88,16 @@ extern "C"

/**
* @brief Free the controller instance.
*
*
* @param ctrl
*/
void MAA_FRAMEWORK_API MaaControllerDestroy(MaaControllerHandle ctrl);

/**
* @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.
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion include/MaaFramework/Instance/MaaCustomController.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @brief Custom controller API.
*
* @copyright Copyright (c) 2024
*
*
*/

#pragma once
Expand Down
93 changes: 47 additions & 46 deletions include/MaaFramework/Instance/MaaInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @brief The instance API.
*
* @copyright Copyright (c) 2024
*
*
*/

#pragma once
Expand All @@ -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.
Expand All @@ -54,7 +55,7 @@ extern "C"
*
* @param inst
* @param res
* @return MaaBool
* @return MaaBool
*/
MaaBool MAA_FRAMEWORK_API MaaBindResource(MaaInstanceHandle inst, MaaResourceHandle res);

Expand All @@ -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);

Expand All @@ -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,
Expand All @@ -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);

Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -161,43 +162,43 @@ 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);

/**
* @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);

Expand All @@ -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);

Expand Down
37 changes: 19 additions & 18 deletions include/MaaFramework/Instance/MaaResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @brief The resource API.
*
* @copyright Copyright (c) 2024
*
*
*/

#pragma once
Expand All @@ -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);

Expand All @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions include/MaaFramework/MaaAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
*
* @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:
*
* - MaaInstance.h
* - MaaController.h
* - MaaResource.h
* - MaaToolkitDevice.h
*
*/
*
*/
Loading

0 comments on commit 18bde82

Please sign in to comment.