I've seen good arguments for both allocating on the server and on the
client.  It appears that performance is better in the former case so
I've used that in the new IATableCell interface, i.e.

Server side allocation:
  HRESULT columnHeaderCells ([out, size_is(,*nColumnHeaderCells,)]
IUnknown ***cellAccessibles,[out, retval] long *nColumnHeaderCells)
vs. Client side allocation:
  HRESULT relations ([in] long maxRelations,[out, size_is(maxRelations),
length_is(*nRelations)] IAccessibleRelation **relations,[out, retval]
long *nRelations)

Unfortunately, the array situation in IA2 came about as a result of my
not understanding IDL arrays at the time IA2 was created.  There are now
three styles:

1) Client side allocation: IA2::relations and IARelation::targerts
2) Server side allocation:  IATableCell::row/columnHeaderCells
3) Sever side allocation:  all the rest (with an unused max parameter),
for example:

HRESULT extendedStates ([in] long maxExtendedStates,[out, size_is(,
maxExtendedStates), length_is(,*nExtendedStates)] BSTR
**extendedStates,[out, retval] long *nExtendedStates)

Getting back to relations, due to the client side allocation in
IA2::relations, the number of relations is needed before allocating. 
I'd use style 2 arrays in either IAccessible22  or
IAccessibleRelationships, whichever way we decide to go.

Pete
---
Carolyn MacLeod wrote:
>
> I am wrong about deprecating nRelations if "relation" is gone, because
> the client is allocating the array and they would want to use the
> correct amount of memory.
> (Sorry about that - I tend to view things from the server's point of
> view <g>).
>
> So if IAccessibleRelationships was ever added, it would need
> nRelations as well, because "It is considered a best practice for the
> client to allocate and free the arrays." (Why is that, anyhow?)
>
> Carolyn
>
>
>
> From:         Carolyn MacLeod/Ottawa/i...@ibmca
> To:   [email protected]
> Cc:   [email protected], IA2 List
> <[email protected]>
> Date:         22/10/2009 11:07 AM
> Subject:      Re: [Accessibility-ia2] Relations
> Sent by:      [email protected]
>
>
> ------------------------------------------------------------------------
>
>
>
>
> I was just teasing when I mentioned IAccessible3...
> I think deprecating IAccessible2 would be really confusing to
> everyone, no matter what the new interface's name is.
>
> Perhaps something like this might be a bit less wild?
> - deprecate IAccessible2::nRelations, relation, relations
> - add IAccessibleRelationships which has only 2 methods: relations and
> relationsForType
> (although I guess then AT's would have to QI or QS to get an object's
> relations, which is more work for a pretty common thing...)
>
> The simplest thing to do for now is just deprecate
> IAccessible2::relation because it really is a problem (and nRelations
> too, because it wouldn't be needed without relation?) and everybody
> only uses IAccessible2::relations.
> Realistically, how many relations does any object have? I honestly
> don't have a feel for it... can it be quite a lot?
>
> Carolyn
>
> From:         Pete Brunet <[email protected]>
> To:   IA2 List <[email protected]>
> Date:         22/10/2009 10:27 AM
> Subject:      [Accessibility-ia2] Relations
> Sent by:      [email protected]
>
>
>
> ------------------------------------------------------------------------
>
>
>
> Over the last year or so there have been several posts pointing out
> the shortcomings of IA2::relation(s).  I think this is serious enough
> that I'd like to get this fixed at some convenient point.  We'd have
> to deprecate IAccessible2 and add IAccessible22 (or IAccessible2_2 if
> you'd prefer).  
>
> Please send me you input either on the list or in a private email
> regarding the best time for adding the new interface.  I'd like to add
> it as an additional interface for the IA2 v2 IDL (which was recently
> updated to add IATable2 and IATableCell), but let me know if that
> would be a problem.
>
> Is this what is needed?
>
> Remove: nRelations, relation, relations
>
> Add:
> HRESULT relation ([in] BSTR *relationType, [out, retval]
> IAccessibleRelation **relation)
>
> -- *
> Pete Brunet*
>                                                                
> a11ysoft - Accessibility Architecture and Development
> (512) 238-6967 (work), (512) 689-4155 (cell)
> Skype: pete.brunet
> IM: ptbrunet (AOL, Google), [email protected]_
> <mailto:[email protected]> (MSN)_
> __http://www.a11ysoft.com/about/_
> Ionosphere: WS4G _______________________________________________
> Accessibility-ia2 mailing list
> [email protected]_
> __https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2_
>
> _______________________________________________
> Accessibility-ia2 mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2
>
>
_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2

Reply via email to