After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336562 - Exposing AT-SPI AccessibleSelections
Exposing AT-SPI AccessibleSelections
Status: RESOLVED FIXED
Product: dogtail
Classification: Deprecated
Component: Framework
CVS HEAD
Other Linux
: Normal normal
: ---
Assigned To: Dogtail Maintainers
Dogtail Maintainers
Depends on: 336561
Blocks:
 
 
Reported: 2006-03-30 02:26 UTC by Peter Johanson
Modified: 2006-04-01 02:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to expose AccessibleSelection instances. (1.02 KB, patch)
2006-03-30 02:27 UTC, Peter Johanson
none Details | Review
Enhanced patch to add support to atk selection in dogtail (1.91 KB, patch)
2006-03-30 11:58 UTC, Jose Dapena Paz
reviewed Details | Review
Revised patch with simpler API (2.52 KB, patch)
2006-04-01 01:20 UTC, Zack Cerza
none Details | Review
Revised patch + deselect() (2.87 KB, patch)
2006-04-01 02:03 UTC, Zack Cerza
none Details | Review

Description Peter Johanson 2006-03-30 02:26:43 UTC
dogtail doesn't currently expose an API for dealing with AccessibleSelection instances. Patch to follow which adds this API. Depends on bug #336561 which adds the binding ofAccessibleSelection to pyspi.
Comment 1 Peter Johanson 2006-03-30 02:27:15 UTC
Created attachment 62344 [details] [review]
Patch to expose AccessibleSelection instances.
Comment 2 Jose Dapena Paz 2006-03-30 11:58:25 UTC
Created attachment 62381 [details] [review]
Enhanced patch to add support to atk selection in dogtail

I got Peter's patch, and added some functions to make it more confortable to
use.
   * Added a "selectedChildren" attribute to Node, enabling you to recover the
set of selected accessibles.
   * Added a "select()" method to Node. It gets the parent and selects the node
in the parent. It should fix #333887 (navigation through tabs in dogtail).

As an example of how to select a tab would be:

focus.application('gedit')
focus.widget(roleName='page tab', name='My tab')
focus.widget.node.select()
Comment 3 Zack Cerza 2006-03-31 18:54:49 UTC
I think the right way to expose this is:

node instance (f.e. page tab list)
 Node selectedChild() - returns the selected node

node instance (f.e. page tab)
 bool isSelected
 bool select()

Exposing anything else publically would be too complex. We can easily hide the pyspi methods and just expose these two methods and one property.
Comment 4 Zack Cerza 2006-04-01 01:18:47 UTC
Here's my patch. It adds everything I proposed, except selectedChild() is now the selectedChildren attribute, returning the list of selected children since apparently multiple children can be selected (Jose got this right, I overlooked it ;). It also adds the indexInParent attribute, such that node.parent.children[node.indexInParent] would give you the same node.

It also adds selectAll(), to select all the children; and deselectAll, to deselect all selected children.

AT-SPI does provide a deselectSelectedChild(), but the index it wants is not the index in its parent, but something in range(foo.getNSelectedChildren()). There doesn't seem to be a reliable way for a node to track what its "selection index" is, so we'll have to deal with the fact that if you want to deselect any node, you have to call node.parent.deselectAll() instead of being able to call node.deselect().
Comment 5 Zack Cerza 2006-04-01 01:20:11 UTC
Created attachment 62501 [details] [review]
Revised patch with simpler API
Comment 6 Zack Cerza 2006-04-01 02:03:15 UTC
Created attachment 62502 [details] [review]
Revised patch + deselect()

Peter thought of a good way to implement deselect(), so I implemented it and added it to the patch. Yay!
Comment 7 Zack Cerza 2006-04-01 02:25:49 UTC
OK, I've committed the patch. deselect() is hard to test, so I'll have to test it later. If anyone finds that it doesn't work where it should, please reopen. Thanks guys!