I wanted to send an update on this. I’ve gotten the glyph rects working, but this hasn’t resolved the problem.
Accessibility Inspector can see these links, and reports that they’re placed correctly. And yet VoiceOver doesn’t allow me to click them, and doesn’t mention that they are links when I step to them using VO-arrows.
The only hint is that I get this error, although it's intermittent:
2014-08-19 17:51:02.100 StaticTextAccessibility[69997:303] AX Client Error: An accessibility client attempted to observe "AXUIElementDestroyed" on non-observable element: <LinkProxyObject: 0x61800007d080>. The error kAXErrorNotificationUnsupported has
been reported to the client.
Not sure what exactly this means, but I think it has cropped up since my last message. Should it inspire confidence that the LinkProxyObject is clearly being dealt with by the accessibility system, or is it meaningless?
James suggested in the original email in 2008 that the OP “will also want to" implement NSAccessibilityRTFForRangeParameterizedAttribute. However, I’ve tested it and that attribute is never called so I’ve left it unimplemented for the time being. In what
circumstances would the RTF attribute be used instead of the attributed string attribute?
Here’s the latest version of the sample app that I’m testing this with:
Thanks in advance,
-Nick
On Aug 17, 2014, at 22:41, Nick Kocharhook < email@hidden> wrote:
On Aug 15, 2014, at 20:47, Boris Dušek < email@hidden> wrote:
But to the std::map (in our case std::map<NSRange, LinkProxyObject*> - the point is in NSDictionary you can search only for exact match of key - i.e. if you have a link at range (100, 7) and VO requests AXAttributedStringForRange for
(102, 10), you would have no way to get at the link at (100, 7) without walking all values in the NSDictionary (valueForKey:(102, whatever) would return nil, under reasonable assumption there are no overlapping links), and you do need to add part of that link
at (102, 5) to the returned attributed string for (102, 10). But with std::map, you can ask for first value (in our case link) whose key (in our case the range) satisfies an inequality (I mean the lower_bound and upper_bound member functions), so with this
you could get all links that intersect with a certain range in O(log N) (N is the length of the whole text), if for the comparison function of the std::map you use numerical comparison of the location of the range. But if we are speaking about some text that
fits into one screen, I think you should not bother with this yet (however make your own performance measurements :-).
well, now I realize you could do it efficiently without the std::map if you specified [parameter rangeValue] for the inRange: parameter and query selfAttString directly for the border cases…
Yes, I figured that out too. But as you rightly said in your followup, I need to make sure that I’m always returning the same child objects. I tried always creating the objects on the fly (both for AXChildren and separately for the parameterized attributed
string), and VO complained that it couldn’t find the proxy object returned from the parameterized method in the list of children.
I’m at a loss for how to do this properly though given a situation like this:
There are more things in heaven [and] earth, Horatio
If just the single word “and" is selected by the parameterized range, should I really return the same link proxy object as AXChildren has? After all, that object will return a title of “heaven and earth”. But perhaps VO is smart enough to figure that out…
Anyway, I’ve tried that approach and fixed the other problems you’ve pointed out. They’re all in this new version, which sadly still doesn’t work yet:
-Nick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|