Igalia / acacia

Library for inspecting accessibility APIs
https://igalia.github.io/acacia
GNU Lesser General Public License v2.1
8 stars 1 forks source link

Return AtspiNode by object, instead of by a unique pointer #106

Closed spectranaut closed 8 months ago

spectranaut commented 8 months ago

Alice made a change to return AXAPINodes by object, because they are relatively small (just wrappers around a pointer to the native accessible object). This allows us to return a vector or list of objects and use them in the scripting language.

When we use a unique::ptr, we run into issues. When we use a regular ptr, we won't know when to clean up.

for functions like:

We will probably also want to write an isNull: https://github.com/Igalia/AXAccess/pull/113

alice commented 8 months ago

To expand on "run into issues": When trying to wrap a vector<unique_ptr<X>> into a native list/array type, SWIG wants to be able to construct a default unique_ptr<X>, which isn't possible. So, either we'd have to write custom read-only list types for each language (think NodeList), or else not use unique_ptrs.