Hi Arnstein,

Reading through your use case, it seems to me you have identified that the IA2 API provides a way to get what you are seeking: every time the user types a character or moves the caret, an event is fired.  You state that your code would be complicated by having an event loop in it, and so are therefore seeking additional work by every mainstream application to provide an additional API call that is otherwise redundant with information already provided - in order to save your single AT application some additional code work (because each such event includes the accessible which generated it, your proposed accessibleWithCaret() is simply getting information your event handler could have cached).

What your use case doesn't make clear to me is how your product will be making use of the information it retrieves from this proposed new API call.  Would your product be polling the app in order to get this information?  What is the user scenario (step by step) for which X would be seeking the accessible with caret (and then presumably doing something with that caret - e.g. re-rendering the text in the neighborhood of the caret in some alternate fashion)?


Regards,

Peter

On 12/10/2010 5:25 PM, Arnstein Skåra wrote:
Here is an use case and additional information:

Joe = any user.
X = our product. A .Net GUI application, providing textual feedback.

Use case:
---------
1. Joe is writing in Firefox, he is also using X. He expects to get 
feedback on what he writes through X.
2. X needs to know where and what Joe is writing. X already knows he is 
writing in Firefox.
3. X will use IAccessible2 to communicate with Firefox, to get what it 
needs.
4. X will conform to the IAccessible2 implementation guide for a client. 
It will find the focused object (see below),  and traverse the document 
hierarchy to find the caret object.
5. The caret object will give X what it needs to report back to Joe.

Motivation:
-----------
X needs non-event based IA2 client code to be isolated in a C dll. IA2 
already provides the means to satisfy X.

Problem:
--------
But Joe is not satisfied, he is experiencing inconsistent timing of 
feedback from X.
The cause is located in use case step 4. The time it takes to find the 
caret object depends on the document currently
being viewed. The deeper the a11y tree the worse the performance. An 
example of a deep tree can be viewed at  www.inetword.com.
Joe shouldn't have to experience this inconsistency.

Solution:
---------
IA2 spec should relieve any IA2 client of the need to traverse the 
document hierarchy to find the caret object.
In a document the caret can only be at one location at any given time. I 
assume an IA2 server knows at any given time
where the caret object is, therefore it should be easy to provide it to 
a client. Such as through the proposed  accessibleWithCaret() method.

The design choice of the DLL:
-----------------------------
IA2 doesn't require a client to be listening to events.
If the DLL would subscribe to events with SetWinEventHook(), it will 
need a message queue.
A message queue requires a GUI thread, at the very least you need to 
create a message-only window in a new thread.
You will then have to deal with that operations are not mutually 
exclusive. For example X calls the DLL, and the DLL's message-only 
window is notified by an event at the same time.
It is simply put more complicated than it needs to be. Adding the 
accessibleWithCaret() method is beneficial regardless of choice of 
client approach.

How to find the focused object in a non-event based client:
-----------------------------------------------------------
1. GetGUIThreadInfo(). See 
http://msdn.microsoft.com/en-us/library/ms633506%28VS.85%29.aspx
2. AccessibleObjectFromWindow(hFocusedWindow, OBJID_CLIENT, 
__uuidof(IAccessible), (void**)&accObj).
3. Focused MSAA object = accObj->get_accFocus().

- Arnstein

On 08.12.2010 16:49, Alexander Surkov wrote:
Hi, Pete.

The issue is we want to avoid to check whether caret is inside of text
accessible that this method is called for. Perhaps this method should
be defined on top level accessible like application accessible. It
should work until AT want to know whether the caret is contained by
some text accessible, i.e. if AT need to get is a direct text
accessible having a caret and caret offset within it.

Also it makes sense to consider different version of the method that
returns caret offset additionally like:
[propget] HRESULT accessibleWithCaret ([out, retval] IUnknown
**accessible, [out] long* caretOffset);

Thank you.
Alex.


On Wed, Dec 8, 2010 at 11:30 PM, Pete Brunet<[email protected]>  wrote:
We could create IAText2 and add this method.  Are there any issues with this
proposal?  (I'd have to look though my docs to see what else we might have
talked about over the last year or two that could also be added for
IAText2.)

Pete
--
Pete Brunet

a11ysoft - Accessibility Architecture and Development
(512) 238-6967 (work), (512) 689-4155 (cell)
Skype: pete.brunet
IM: ptbrunet (AOL, Google), [email protected] (MSN)
http://www.a11ysoft.com/about/
Ionosphere: WS4G

Arnstein Skåra wrote:

Hi!

A brief description of the current situation:
1.Place caret within a paragraph.
2.Get the focused IAccessible object.
3.Traverse it's children to find the IAccessible2 object containing the
caret.

This approach is how you are supposed to do it, according to the
implementation guide.
It is a very time consuming operation. An example of how bad it can get is
www.inetword.com.

Alexander Surkov proposed a method to deal with it:

[propget] HRESULT accessibleWithCaret ([out, retval] IUnknown **accessible);

Returns the accessible object containing the caret.  If the caret is in
an accessible in a tree of accessibles the returned accessible is the
one actually containing the caret, i.e. a leaf node in the
accessibility tree.

Parameters:

      [out] accessible   The returned accessible contains the caret.

Returned Values:

      S_OK
      S_FALSE   if there is no accessible in the entire accessible hierarchy
containing a caret


- Arnstein

_______________________________________________
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



_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2

--
Oracle
Peter Korn | Accessibility Principal
Phone: +1 650 5069522
500 Oracle Parkway | Redwood City, CA 94065

Green
          Oracle Oracle is committed to developing practices and products that help protect the environment
_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2

Reply via email to