[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Describing an application state in ATK, without Gtk




On 22/06/15 03:21, Luca Saiu wrote:
> Hello.
>
> I'm trying to find a clean way of using ATK to encode the state of an
> application which doesn't rely on any toolkit -- actually a Compiz
> plugin.
>
> The application does its own graphic rendering, so it's not desirable to
> introduce a GTK dependency.  For the current time the application state
> to provide the accessibility subsystem with is as simple as it gets:
> just one text label, whose value changes under the control of the
> application.

So it would be something like a notification with the state of the
application?

> I've played with ATK but I'm sure there's something I don't get.  The
> most comprehensible examples I've found are in the atk testsuite, but
> those are obviously intended as unit tests, and running them has no
> influence on the state of AT-SPI. 

I will try to explain it with the usual client-side terminology (as you
mention below that it was how it was previously explained to you). From
the accessibility POV, the client side are the accessibility tools like
Orca, Dasher etc. The server side are the applications (text editor,
music player, etc), as are the ones that has the information that the
client applications show to the user in alternative ways. Under that
terminology, ATK is the server side abstraction library. The purpose of
ATK is just "shaping" the visual information to a common base. So going
for the minimum, for each individual and relevant (focusable, providing
info) ui element on your app, you should ensure that has a proper name,
role (ie: ATK_ROLE_BUTTON) and state set (ie:
ATK_STATE_ACTIVE+ATK_STATE_CHECKED, etc).

So ATK purpose is only exposing an application widget hierarchy on an
accessibility friendly way.


>  Shall I call the atk-atspi bridge
> directly?  Shall I initialize it somehow?  

But yes, you are right, at some point, you want to get that info and
expose it to the accessibility tools. On the old times, you needed to
load your ATK implementation as a module (a plugin), but right now can
just call the bridge initialization. The method is
atk_bridge_adaptor_init [1]. GTK calls it on its initialization phase.
But as you mentioned that you don't want to use GTK, another example is
gnome-shell, that call it manually [2].

In summary, that call initializes the atk bridge with at-spi, so all the
info of your application that you shaped with ATK is exposed through
D-BUS. Then the accessibility tools can use libatspi, that is the
client-side accessibility library, to get all the info.

> [1] recommends the Gail
> source as an example of advanced ATK use, but the thing is still tightly
> coupled with GTK.

Unfourtunately that guide is outdated, and as you say, really oriented
to GTK. At that time GAIL, was the most complete ATK implementation.
Right now, GAIL is not anymore the library providing the ATK support for
GTK 3.0. Clutter implements ATK and it doesn't use gtk at all.
>
> Speaking of AT-SPI, I've also thought of avoiding the problem altogether
> by just linking to libatspi; some people on the net say it's only meant
> for accessibility "clients" while I clearly need a server; the API would
> seem to reflect that, but others [2] say that ATK and AT-SPI are more or
> less functionally equivalent, citing the Java Accessibility Framework
> (which as far as I understand has been recently abandoned [3]) as an
> example of skipping ATK.  It's disheartening that every "server" example
> is so intertwined with huge toolkit implementations.

I hope that my explanation of what "client" and "server" could clarify
your doubts. As far as I understand your problem, and as others say,
linking directly to libatspi would not solve your issue. libatspi is
intended to be used to write accessibility tools, like Orca.

> Making a factory for an AtkText subclass is clearly not enough. 

Using factories are discouraged right now. I have plans to deprecate
them, and my bad if I didn't do it yet and I confused you.

>  I'd
> already be happy with the simplest C program with an element showing up
> in accerciser.  

In addition to the small tests at atk, you can find some tests at
at-spi2-atk/tests. They are still unit tests, but they set all the
stack. Take a look to see if it is what you need.

> Would you have any suggestion for my case?  Thanks,
>
> [1] https://developer.gnome.org/accessibility-devel-guide/stable/dev-start-5.html.en
> [2] https://accessibility.kde.org/developer/atk.php
> [3] https://bugs.openjdk.java.net/browse/JDK-8067481
>
[1]
https://git.gnome.org/browse/at-spi2-atk/tree/atk-adaptor/atk-bridge.h#n32
[2] https://git.gnome.org/browse/gnome-shell/tree/src/main.c#n272

-- 
Alejandro Piñeiro (apinheiro@igalia.com)


Reply to: