-
Notifications
You must be signed in to change notification settings - Fork 3
feat: update C API bindings to MaaFramework v5.8.1 #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2a4ca45
chore: update interop to framework v5.7.2
moomiji 748a10b
chore(UnitTests): fix test cases
moomiji 34e9208
chore: update Win32ScreencapMethod document
moomiji 11ed711
feat: support IMaaController.Inactive()
moomiji c7c1bff
feat: support MaaWlRootsController
moomiji 2fc6417
feat: support IMaaController.Info
moomiji 5d5ebe4
chore: update interop to framework v5.8.1
moomiji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/MaaFramework.Binding.Native/MaaController/MaaWlRootsController.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| using System.Diagnostics; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using static MaaFramework.Binding.Interop.Native.MaaController; | ||
|
|
||
| namespace MaaFramework.Binding; | ||
|
|
||
| /// <summary> | ||
| /// A wrapper class providing a reference implementation for <see cref="MaaWlRootsControllerCreate"/>. | ||
| /// </summary> | ||
| [DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
| public class MaaWlRootsController : MaaController | ||
| { | ||
| #pragma warning disable IDE0032 // 使用自动属性 | ||
| private readonly string _debugWlrSocketPath; | ||
| #pragma warning restore IDE0032 // 使用自动属性 | ||
|
|
||
| [ExcludeFromCodeCoverage(Justification = "Debugger display.")] | ||
| [DebuggerBrowsable(DebuggerBrowsableState.Never)] | ||
| private string DebuggerDisplay => IsInvalid | ||
| ? $"Invalid {GetType().Name}" | ||
| : $"{GetType().Name} {{ WlrSocketPath = {_debugWlrSocketPath} }}"; | ||
|
|
||
| /// <summary> | ||
| /// Creates a <see cref="MaaWlRootsController"/> instance. | ||
| /// </summary> | ||
| /// <param name="wlrSocketPath">The wayland socket path (e.g., "/run/user/1000/wayland-0").</param> | ||
| /// <param name="link">Executes <see cref="IMaaController.LinkStart"/> if <see cref="LinkOption.Start"/>; otherwise, not link.</param> | ||
| /// <param name="check">Checks LinkStart().Wait() status if <see cref="CheckStatusOption.ThrowIfNotSucceeded"/>; otherwise, not check.</param> | ||
| /// <remarks> | ||
| /// Wrapper of <see cref="MaaWlRootsControllerCreate"/>. | ||
| /// <para>This controller is designed for wlroots on Linux.</para> | ||
| /// </remarks> | ||
| /// <exception cref="ArgumentException"/> | ||
| /// <exception cref="MaaJobStatusException"/> | ||
| public MaaWlRootsController(string wlrSocketPath, LinkOption link = LinkOption.Start, CheckStatusOption check = CheckStatusOption.ThrowIfNotSucceeded) | ||
| { | ||
| ArgumentException.ThrowIfNullOrEmpty(wlrSocketPath); | ||
|
|
||
| var handle = MaaWlRootsControllerCreate(wlrSocketPath); | ||
| _ = MaaControllerAddSink(handle, MaaEventCallback, (nint)MaaHandleType.Controller); | ||
| SetHandle(handle, needReleased: true); | ||
|
|
||
| _debugWlrSocketPath = wlrSocketPath; | ||
|
|
||
| if (link == LinkOption.Start) | ||
| LinkStartOnConstructed(check, wlrSocketPath); | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions
3
src/MaaFramework.Binding.UnitTests/SampleResource/properties.json
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ControllerActionDetail now requires an
infoJSON field, but MaaMsg.Controller.Action's documented payload (auto-generated in MaaMsg.cs) still lists only{ ctrl_id, uuid, action, param }. Ifinfomay be absent (e.g., older runtimes), deserialization into a non-nullableJsonElementcan be ambiguous (default ValueKind.Undefined). Consider makingInfonullable (JsonElement?) and/or updating the MaaMsg payload documentation/generator to match the new schema.