Confusion When Trying to work With Gir

Hello,

I am trying to generate Atspi bindings for Rust, and I am hitting a few snags along the way.

First off, what are the prefered gir files to use? For now, I am using the gir files that pacman provided when I installed my desktop environment, but I am not exactly certain if those are the best ones to use or if this really has any effect.

Secondly, who provides the dbus_sys crate or is this something will also have to manualy generate?

Finally, I did git some form of lower level FFI binding to work, but when it comes to the high level safe bindings, I am confused as to how to get started. For now, I had simply done gir -m not_bound | grep “[NOT GENERATED]” to get the high level items that were not methods or functions and add them to the generate section of the safe Gir.toml. What is a good strategy to fix the remaining issues when working with unbound items? (Working with the gir ecosystem is relatively new to me).

For reference, the code I am working on is here..

The main question I’d like to ask is: what are you trying to achieve by using libatspi?

The end goal is to have a working screenreader. As far as I know, libatspi is the library that gives assistive technologies the support they need to run.

Right, the main problem is that libatspi isn’t really “up to date” when it comes to the modern stack.

For instance, it uses libdbus directly, instead of GIO; additionally, its implementation is not entirely specified, which means implementing both sides of the AT-SPI interfaces isn’t the easiest thing to do. A lot of logic is deferred to the client itself, which generally means Orca.

Personally, I’d recommend starting from the XML description of the AT-SPI interfaces, and then figuring out how to implement the AT side using crates like zbus, instead of using libatspi directly. You’ll mostly have to re-implement the logic to find the accessibility bus, and register on it; but other than that, you should be fine with listening to messages on that bus.

2 Likes

Okay, will do that instead; it sounds a lot easier then trying to fiddle with the gir files. Where can I find examples that use zbus_xmlgen? I’ve figured out how to find the bus by hand and can probably code something up quite easily, but eventually I will need to see examples of how people use the generated Rust code from the XML.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.