Re: [orca-list] How to tell if Orca is running?
- From: Mike Gorse <mgorse alum wpi edu>
- To: Carolyn MacLeod <Carolyn_MacLeod ca ibm com>
- Cc: orca-list gnome org
- Subject: Re: [orca-list] How to tell if Orca is running?
- Date: Fri, 26 Apr 2013 13:45:30 -0400 (EDT)
Hi Carolyn,
AT-SPI keeps track of ATs listening for events, to avoid sending out
events that aren't needed, but it doesn't currently provide a particularly
convenient API to expose that information to applications or a way for an
application to tell what kind of AT is running. I should probably add
something to do this for 2.10; there is an open bug for it, as Joanie
pointed out. However, it is possible to query the registry daemon to
determine whether anything is listening for events, by doing the
programmatic equivalent of this:
dbus-send --type=method_call --print-reply --dest=org.a11y.atspi.Registry /org/a11y/atspi/registry
org.a11y.atspi.Registry.GetRegisteredEvents
This method call needs to be made on the accessibility bus (which is
distinct from the session bus), so you first need to fetch the address for
the accessibility bus. If you are going to use libdbus, then you can call
atspi_get_a11y_bus() in libatspi to get a DBusConnection to it. If you
want to use gdbus or some other D-Bus binding, then I'd suggest looking at
the code for atspi_get_a11y_bus(), since you'll need to replicate it,
although it should suffice to just fetch the address via the bus launcher
(ie, to port get_accessibility_bus_address_dbus).
If GetRegisteredEvents isn't implemented (ie, for older versions of
AT-SPI2), then you'd need to assume that something might be listening.
There are also signals (EventListenerRegistered and
EventListenerDeregistered) that the registry daemon sends out when event
listeners are added or removed.
Hth,
-Mike
On Mon, 22 Apr 2013, Carolyn MacLeod wrote:
Thanks, Julien.
I'm sure that would work (assuming that I am always looking for the string "orca") but it seems a bit
heavyweight to list all processes whenever anyone types an arrow key in a
table.
I was hoping that there would be a system flag somewhere.
Joanie? Do you set/clear a flag somewhere to say "there's an AT running"? Sort of like the Mac and Windows
examples I sent?
Thanks,
Carolyn
From:
Julien Claassen <julien mail upb de>
To:
Carolyn MacLeod/Ottawa/IBM IBMCA,
Cc:
orca-list gnome org
Date:
04/19/2013 04:50 PM
Subject:
Re: [orca-list] How to tell if Orca is running?
________________________________________________________________________________________________________________________________________________________________________________
Hello Carolyn!
I've never done that in code myself, but you could do it the easy way,
executing "ps -ax". ps relies onthe /proc filesystem, which is present on all
Linux systems. There are some functions to use the information presented
through /proc. I believe it's part of glibc.
I hope this helps.
Warm regards
Julien
----------------------------------------
http://juliencoder.de/nama/music.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]