-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added a (very) basic tree walking functionality for Mac #49
Conversation
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.
This all looks good and works for me! A few questions, and I wonder about next steps
lib/mac/mac_inspect.i
Outdated
|
||
%include <std_unique_ptr.i> | ||
%unique_ptr(mac_inspect::AXAPINode) | ||
|
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.
wow was this move necessary to get this to work? you mentioned you were having trouble with the shared pointer
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.
Hmmm, I thought it was, but I just moved it back, and it still worked. It looks like the actual fix was prefixing AXAPINode
with mac_inspect::
in the %unique_ptr
macro.
chars = ns_chars ? ns_chars : ""; | ||
} | ||
return std::string(chars); | ||
} | ||
|
||
AXAPINode::AXAPINode(AXUIElementRef ax_element) : ax_element_(ax_element) {} | ||
AXAPINode::AXAPINode(AXUIElementRef ax_ui_element) | ||
: ax_ui_element_(ax_ui_element) {} |
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.
just curious the motivation for this name change?
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.
Just making it match the platform type name more closely, because I was confusing myself :)
(AXUIElementRef)CFArrayGetValueAtIndex(children_ref, index); | ||
if (!child_ref) | ||
return nullptr; | ||
return AXAPINodePtr(new AXAPINode(child_ref)); |
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.
So I think all of these helper functions, ultimately, might only be implemented in AxapiNodeImpl, like the AtspiNodeImpl: https://github.com/Igalia/AXAccess/pull/43/files#diff-3d31a27d5b501604330a8b1dd58434d1a6848428ec6b28afdefc85002e1e439b
And ultimately a goal for the test suite is to surface AXUIElementCopyAttributeValue
almost directly, in order to test?
I wonder if the next step is to for you to copy the outline presented in Edu's PR?
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.
Also I wonder if "GetChildCount" and "GetChildAt" are the right abstractions for the "cross platform" part of the API.
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.
[...] And ultimately a goal for the test suite is to surface
AXUIElementCopyAttributeValue
almost directly, in order to test?
Yeah, makes sense!
I wonder if the next step is to for you to copy the outline presented in Edu's PR?
Yeah, once that change lands I can work on making the Mac version of NodeImpl
, moving these functions over there and making this a much thinner wrapper around the Mac APIs.
Also I wonder if "GetChildCount" and "GetChildAt" are the right abstractions for the "cross platform" part of the API.
Yeah, good question. Do you think potentially returning a std::vector<NodePtr>
might be more ergonomic?
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.
It just seems to make more sense from a scripting language perspective. We can change it at a future time!
No description provided.