Standardized High-Level Language Object-Oriented Interface Design 
Binding can be divided into two steps:
- Standardize the OOP (Object-Oriented Programming) encapsulation of the C API. Since the MaaFW (Mobile Application Framework) interface is relatively stable, once this step is completed, it does not require long-term maintenance.
 - Based on step 1, parse parameters such as callback messages, detail JSON, and pipeline overrides, and encapsulate them into different functions and structures. These fields may change with MaaFW updates and will need long-term follow-up with new versions of MaaFW.
 
If you wish to add a binding for a certain language to MaaFW, you can choose one of the following methods according to your available time and resources:
Standardized Interface 
- MaaTasker, MaaResource, MaaController should be encapsulated as objects rather than procedural interfaces. For instance, interfaces like 
MaaContextGetTaskershould return objects rather than handles. You may consider two models:- Add a global handle-object reference dictionary, and use the handle to find and return the original object.
 - The object is stateless and only responsible for referencing handles, directly creating and returning new objects (refer to the 
ownfield in Python bindings). 
 - MaaTaskId, MaaCtrlId, MaaResId and other asynchronous action IDs should not be returned to the integrator. Encapsulate them into a 
Jobclass within the binding, providing methods likewait,status, andget. - The 
Jobclass should provide encapsulations for all methods that can operate on the given ID. For example, thegetmethod ofTaskJobshould return encapsulated data obtained fromMaaTaskerGetTaskDetail. - MaaRecoId, MaaNodeId and other query-type IDs should not be returned to the integrator. The binding should call interfaces like 
MaaTaskerGetRecoDetailand encapsulate the results into structures such asRecoDetailandNodeDetailbefore returning them. - CustomAction, CustomRecognition, NotificationCallback, etc., need to be encapsulated into an agent, preferably a virtual base class. The actual object passed to MaaFW should be a pointer within the agent, which will convert various parameters into types commonly used in the target language before passing them to the integrator.
 - In the agent for CustomAction and CustomRecognition, please encapsulate parameters of 
MaaCustomRecognitionCallback/MaaCustomActionCallback(excluding context) into structures before passing them to the integrator to avoid compatibility issues with future callback parameter additions. The return values should also be encapsulated into structures. - Each enumeration in 
SetOptionshould be split into separate interfaces, such asset_screenshot_target_long_side, rather than providing the specific enumeration to the integrator. - Buffers like StringBuffer, ImageBuffer should not be returned to the integrator. They need to be converted into the target language's standard string and image types before being provided.
 - For interfaces such as BindResource, BindController, RegisterCustom, ensure that a reference is kept to avoid garbage collection issues.
 - For the Find series of interfaces in 
MaaToolkit, directly return encapsulated arrays of structures. - Provide samples where the interface calls should not be fewer than those in the Python samples.
 
Additional Parsing and Encapsulation 
- The NotificationCallback wrapped interface parses the message and dispatches it to different methods (refer to MaaMsg.h). For example, 
on_resource_loading_starting(data). ResourceLoading can also be dispatched as an Event enumeration and Starting as a Type enumeration, such ason_notification(event, type, data). Among them,datais the structure parsed by detail_json, instead of directly giving the original json. - For the NotificationCallback wrapped interface, you can consider adding the on_unknown_notification method to temporarily deal with the subsequent messages added by MaaFW. You can also consider adding the raw field or other fields representing unknown content to the structure parsed by detail_json.
 - Split detail_json obtained by 
MaaTaskerGetRecognitionDetailinto all_results, filtered_results, best_result (note that best may be null), and parse them into different structures according to the algorithm - More: TODO...
 
