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 318223 - at-spi interface additions for Document, and Selector
at-spi interface additions for Document, and Selector
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: api
unspecified
Other All
: Normal enhancement
: ---
Assigned To: bill.haneman
bill.haneman
Depends on: 326520 326522 326529 326530 326531 326532 326535 326536 326538 326539 326540 326542 326543 344421
Blocks:
 
 
Reported: 2005-10-07 17:09 UTC by bill.haneman
Modified: 2006-09-12 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add these features to the IDL definition (61.07 KB, patch)
2005-10-07 17:11 UTC, bill.haneman
none Details | Review
patch, incorporating many of Michael's suggestions (61.25 KB, patch)
2005-10-10 11:56 UTC, bill.haneman
none Details | Review

Description bill.haneman 2005-10-07 17:09:00 UTC
In order to better support complex documents, container queries, and support
command-and-control interfaces between assistive technologies, the above new
APIs are needed.
Comment 1 bill.haneman 2005-10-07 17:11:41 UTC
Created attachment 53188 [details] [review]
patch to add these features to the IDL definition

Includes changes to various interfaces, and new interfaces.  In particular:

Accessibility_Terminal.idl: support for 2d text arrays, i.e. virtual terminals
Accessibility_Collection.idl: support for querying collections according to
various logical conditions and in varying sort orders - particularly useful for
complex documents
Accessibility_Document.idl: marker interface indicating that the elements below
this node in the tree are 'content' as opposed to user agent.  Also includes
some other useful API for instance locale, etc.
Comment 2 Michael Meeks 2005-10-10 10:45:48 UTC
You add 3 methods to Accessible, and remove 2 unimplemented slots :-)
Of course, that changes the C ABI for the (unused & should not be exposed as
public/stable ABI anyway) libspi.

The Collection interface is interesting. IMHO the '_REVERSE_' variants in the
SortOrder look cumbersome & unpleasant. I would prefer a 'getPreviousChildren'
API call instead of that. getPreviousChildren(SORT_ORDER_REVERSE) type stuff
sounds pretty unpleasant.

Wrt. 'AccessibleSet' - I would be very inclined to use:

struct AccessibleSetEntry {
    Role aRole;
    string Name;
    Accessible theAccessible;
    Any expansion;
};
typedef sequence<AccessibleSetEntry> AccessibleSet;

Or somesuch - so that we can shove lots more data of the kind that people want
across the API.

Of course - this sort of thing comes down (again) to whether you think the CORBA
IDL should be used directly programatticaly - IMHO not a good idea :-)

For 'Document' - I'm inclined to believe that people can cope with not having
':'s in their attribute names - I'm less able to believe that they will
correctly (cross-language) escape ':'s in attribute values.

ie. I think it's better to define: [alpha][alphanum]*[colon].* as a attribute
parser - ie. require no escaping of the value at all.

To make that fly; it's only necessary to make Document::getAttributes() to
return a sequence<string> instead of a 1-massive-string thing.

The 'Command' API is somewhat worrying - what is this 'long id' thing in Command
? - that looks bad/scary to me and/or needs documenting properly.

Anyhow - apart from that looks interesting / intriguing :-)

HTH.
Comment 3 bill.haneman 2005-10-10 10:58:16 UTC
1) removal of too few slots was an error. Thanks for catching it, I certainly
intend to keep ABI compatible.

2) the reason for SORT_ORDER_REVERSE is that you sometimes want the "last 10"
elements.  If the Collection in question is large, you need this call for
performance reasons.

3) AccessibleSetEntry is interesting - I would shy away from the Any, since that
has been cumbersome in the past, but agree that Role and Name are very likely to
be of interest in all cases.  I am inclined to agree that AccessibleSet should
be a sequence of AccessibleSetEntry instead of just a sequence of Accessibles.

4) Agreed about Document::getAttributes.

5) the long id in Command is only for purposes of disambiguating Commands with
equal strings.  It happens in GOK for instance, that there can be multiple
Commands with the same name, but the order is exposed to the end-user and the
end-user knows from context which is which.  Ideally it's redundant info, but in
 reality ambiguous cases will crop up from time to time without it.
Comment 4 bill.haneman 2005-10-10 10:59:36 UTC
BTW thanks a lot Michael for your comments.

I still think the programmatic use of IDL is important for support of multiple
language/runtime environments.  We may move to a different model someday, but
that would involve specifying/certifying each language binding separately, which
has its own downside.
Comment 5 bill.haneman 2005-10-10 11:03:29 UTC
one other question regarding "...REVERSE"; the same could be accomplished in
three ways (AFAICS):

1) REVERSE variants of each SORT_ORDER (the currently proposed approach);
2) a "REVERSE" boolean parameter to the getChildren / getNextCHildren /
getPreviousChildren calls;
3) separate calls for reverse order variants of the above.

#2 adds a boolean param, is that nicer?  Not sure.
#3 is bad IMO because it doubles the number of new methods from 3 to 6; there is
a school of thought that doesn't mind method proliferation but I don't subscribe.
We already have getPrevChildren() which serves a similar purpose but does not
reverse the sort order.
Comment 6 bill.haneman 2005-10-10 11:56:44 UTC
Created attachment 53285 [details] [review]
patch, incorporating many of Michael's suggestions

revised patch:
1) fixed bincompat of Accessible
2) returns AttributeSet from Document, instead of doubly-delimited string;
3) defines AccessibleSet as sequence of AccessibleSetEntry structs
Comment 7 George Kraft IV 2005-10-10 15:42:19 UTC
See also: 

http://accessibility.freestandards.org/~gk4/a11y/atspi-101005-bill/
Comment 8 Michael Meeks 2005-10-18 09:37:32 UTC
Hi Bill.

* Other things we might want to add: an 'Accessible application' field in ~every
event emission - for event streaming.

* wrt. bincompat - I'm convinced it's a bad idea to support 'libspi' wrt.
bincompat which is about the only thing you break by expanding structs / interfaces.

* REVERSE: I don't understand the issue - but on the face of it it seems that
all REVERSE does is switch the semantics of 'getNext' 'getPrevious' - is that
the case ? Of course - if we want to get the 'last N' children - we could always
specify that a negative count to getChildren would go from the end.

IMHO adding this extra REVERSE level of complexity to the interface [ and
doubling the size of the enumeration ] will only create a mess that will have to
be elided in some way in the impl. anyway.

Failing that - can we have a bit-field for the enum:

const long REVERSE = 0x8000
const long <other guys>

So that the intention is clearer ?
Comment 9 bill.haneman 2005-10-18 10:53:40 UTC
Thanks Michael;

* application field in events - yes;
* libspi is gnome platform, thus we must maintain bincompat 
* REVERSE does not switch semantics of getNext/getPrevious.  getNext and
getPrevious both return the same order, just a different subset.  REVERSE
actually changes the order.  It's particularly critical if I want the "last n
elements" that match a given criterion, as opposed to the first.  

REVERSE is thus entirely necessary.  

I believe that bit-fields are a problem for IDL and for language bindings in
general.

Bill
Comment 10 bill.haneman 2006-01-17 16:02:19 UTC
most of the patch (minus Collection, Terminal, and Document) has now been committed to CVS HEAD.
Comment 11 Calum Benson 2006-04-26 17:05:17 UTC
Apologies for spam... ensuring Sun a11y folks are cc'ed on all current accessibility bugs.
Comment 12 bill.haneman 2006-07-11 15:16:48 UTC
Document is now in CVS HEAD.

We're really only missing Collection and Terminal now (and some minor enhancements to Table, Text, EditableText).
Comment 13 bill.haneman 2006-07-19 10:22:09 UTC
The dependencies are backwards in this bug report - this bug doesn't block the others, but the other way 'round.

Should we really keep this "tracker" bug around?  IMO we can find the relevant issues still open by searching for open RFEs against at-spi...
Comment 14 George Kraft IV 2006-09-12 14:47:48 UTC
I'm okay with closing this tracker bug.
Comment 15 bill.haneman 2006-09-12 16:27:41 UTC
OK - trimming the summary and closing as Fixed, with the caveat that some aspects of this original tracker/rfe are not yet fixed (however they have separate open RFEs and are thus still being tracked).