Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-14 Thread Alexander Surkov
I don't mind. It doesn't sound like that extra method complicates things a lot. But I agree that's not friendly to new implementations. ALex. On Tue, Mar 13, 2012 at 10:49 PM, James Teh wrote: > Hi. > Personally, I don't mind which. However, one issue to consider is that > having two methods incr

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-13 Thread Pete Brunet
It looks like there is agreement on a single method: HRESULT IAccessible2_2::relationTargetsOfType ( [in] BSTR type, [in] long maxTargets, // 0 means get them all [out, size_is(,*nTargets)] IUnknown ***targets, [out, retval] long *nTargets ) // # targets returned On 3/13/12 9:49 PM, Ja

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-13 Thread James Teh
Hi. Personally, I don't mind which. However, one issue to consider is that having two methods increases the work (and potential for error) for server implementers. In contrast, retrieving a single relation via an array method, while perhaps a little less elegant, isn't particularly difficult f

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-13 Thread Pete Brunet
In both cases there has been agreement on the first method (which will be used the vast majority of the time): // Fetch one target, even if there is more than one. HRESULT IAccessible2_2::relationTargetOfType ( [in] BSTR type, [out, retvalue] IUnknown **target ) But there have been two sugges

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-06 Thread Pete Brunet
Thanks Alex, I still prefer 1 rather than 1.1 and 2, but let's see what others say. -Pete On 3/6/12 12:26 AM, Alexander Surkov wrote: > 2nd is more flexible than 1, 1.1 is a nice shortcut for 2 in case of > one target so probably I would go with 1.1 and 2. > Alex. > > On Tue, Mar 6, 2012 at 2:35

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Alexander Surkov
2nd is more flexible than 1, 1.1 is a nice shortcut for 2 in case of one target so probably I would go with 1.1 and 2. Alex. On Tue, Mar 6, 2012 at 2:35 PM, Pete Brunet wrote: > Thanks Alex (and Jamie), I offer two choices, and in both cases using IDL > like our recently added IATable2::selectedR

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Pete Brunet
Thanks Alex (and Jamie), I offer two choices, and in both cases using IDL like our recently added IATable2::selectedRows/Columns/Cells. I like the first choice better because it offers a very simple method for the case that will be used 99% of the time. The second choice is the one Jamie proposed

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Alexander Surkov
Basically that's what Jamie said. We need to make sure the server doesn't do extra work when nobody needs it. So I'm fine with Jamie proposal to pass the desired targets amount. Alex. On Tue, Mar 6, 2012 at 1:19 PM, Alexander Surkov wrote: > ARIA tends to expose multiple targets especially stuffs

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Alexander Surkov
ARIA tends to expose multiple targets especially stuffs like aria-labelledby. I don't have statistics though. But the point is if AT needs only one targets then the server shouldn't spend a time to check whether there are other targets. In other words we can end up with single target but the server

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread James Teh
On 6/03/2012 7:47 AM, Pete Brunet wrote: Jamie, Are there cases where you'd only want one target even when there is more than one? It's hard to say because I can't think of any use cases we care about where there would be more than one target anyway. Actually it seems the only relations that

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Pete Brunet
Jamie, Are there cases where you'd only want one target even when there is more than one? Actually it seems the only relations that might to be an opportunity for more than one target are embeds and parentWindowOf. Is that correct? -Pete On 3/5/12 3:31 PM, James Teh wrote: > On 6/03/2012 7:20 A

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread James Teh
On 6/03/2012 7:20 AM, Pete Brunet wrote: Jamie, Since the server allocates the array, are there any issues for AT regarding the method I proposed? Not directly for ATs. However, fetching multiple targets might be expensive and slow on the server side; if I recall correctly, Alex has concurred w

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Pete Brunet
Jamie, Since the server allocates the array, are there any issues for AT regarding the method I proposed? 99% of the time the array will hold one accessible. Sometimes the number will be higher but if you only want one you can just access the first one in the returned array. If you want all or s

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread James Teh
On 6/03/2012 2:27 AM, Pete Brunet wrote: HRESULT IAccessible2_2::targetsByRelationType ( [in] BSTR type, [out, size_is(,*nTargets)] long **targets, [out, retval] long *nTargets ) This does not have the extra [in] count parameter Jamie proposed so the client doesn't need to know before th

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Pete Brunet
Thanks Alex, That makes sense. In IA2 there are two styles for passing arrays. One example is IA2::relations and IARelation::targets where the client allocates the array. These two methods will not be in 1.3. The other example is where the server allocates the array: IA2::extendedStates/locali

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Alexander Surkov
I wonder if AT needs only one target then would the pointer to the pointer work as an array (like IUnknown* acc and pass &acc to the method)? > IA2_2::nTargetsByRelationType([in] BSTR type, [out,retval] long *nTargets) > IA2_2::targetByRelationType([in] long targetIndex, [out, retval] IUknown > **

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-05 Thread Pete Brunet
Then this would be very simple: IA2_2::nTargetsByRelationType([in] BSTR type, [out,retval] long *nTargets) IA2_2::targetByRelationType([in] long targetIndex, [out, retval] IUknown **target)

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-04 Thread Alexander Surkov
This sounds like a good option with me. The call costs should be lower than in IEnumVariant approach. But if you in 99% percents you need only one target shouldn't we have a method for this to avoid array stuffs? Thank you. Alex. On Mon, Mar 5, 2012 at 10:56 AM, James Teh wrote: > Hi. > > Mick

Re: [Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-04 Thread James Teh
Hi. Mick and I were discussing this same issue this morning. We haven't seen use cases ourselves where there is a need for multiple targets for a given relation type, though I'm sure that there are rare use cases; e.g. one object which controls multiple objects, etc. Even where there are mult

[Accessibility-ia2] IEnumVARIANT vs arrays

2012-03-04 Thread Pete Brunet
IATable2::selectedCells/Columns/Rows returns an array but the proposed new methods: https://wiki.mozilla.org/Accessibility/IA2_1.3#Relations https://wiki.mozilla.org/Accessibility/IA2_1.3#Hyperlinks_from_hypertext specify the return of an IEnumVARIANT. What is the reasoning for that? With the