Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minimum requirements for a NSAccessibility object?




On Aug 23, 2006, at 12:07 PM, Håkan Waara wrote:

James,

I'm working on making Firefox/Gecko use Universal Access to be accessible. Right now, the browser area (and indeed all XUL-based applications) are only like a big unknown "blob" that VO and others do not know what to make of.

That's great!



The only cocoa object we have is in the contentView, where we have a big custom view spanning all of the window. Inside it, all XUL controls, all rendering etc is done.

So I'm implementing this custom accessibility class from scratch that will query the XUL objects in Gecko about their positions, sizes, actions etc, and let this info be available through the NSAccessibility informal protocol. When I get the basics working, I will try to map every XUL widget to the correct accessibility roles and be as consistent as possible with how AppKit's accessibility works.

This has proven to be a great challenge, as I have yet to see the objects even appear in Accessibility Inspector/Verifier or Prefab UI inspector.

I *think* the hierarchy should consistent wrt parent/children relationships (that is, if B has a child A, then A also reports B as its parent) but I'm suspecting it isn't, since the hierarchy doesn't show up yet.

/Håkan

I'm going to respond to you off list with some more questions - but I think to bootstrap you need your custom accessibility object to hook into the existing accessibility hierarchy in the Cocoa app.  So you will need to override some of the accessibility methods in the view that the rendering is done in.

In the containing view override accessibilityAttributeValue:, and if the attribute value is NSAccessibilityChildrenAttribute, then you will want to return an array of your custom UI elements (or the top level custom UI element, if there is a root object).

In addition, you will want to override the hit and focus testing methods:

- (id)accessibilityHitTest:(NSPoint)point;
- (id)accessibilityFocusedUIElement;

in the view to call the same method in the appropriate child.  It would be OK if the content view had one accessibility child, which represented the "AXWebArea".  If that were the case, then in the content view, you would simply call the hit and testing methods in the accessibility child.

-James



23 aug 2006 kl. 20.43 skrev James Dempsey:

Håkan,

Can you tell me a little bit more about the object that you are trying to make accessible?  What is it a subclass of?

Since you are implementing the accessibility protocol from scratch, I am guessing that this object is a subelement of a custom view or control, and is not a view or cell itself.

A second question would be where does this object draw itself?  Is it custom drawing within a view or control?  If so, then the parent of this object needs to report it as one of its children, and needs to implement its accessibility hit testing / focus testing methods to call this object's accessibility hit testing / focus testing methods.

If you could provide a little more info about what you are doing, that would be very helpful.

You might also take a look at the following code samples, which show two different methods of making an object accessible from scratch:


Thanks,

James



On Aug 23, 2006, at 6:46 AM, Håkan Waara wrote:

What's the absolutely required methods and attributes that a generic NSAccessibility object must support to show up in Accessibility Verifier and Accessibility Inspector?

Currently they simply do not show my objects (and don't really help me in determining what's missing). I'm supporting the following methods:

// general
- (id)accessibilityHitTest:(NSPoint)point;
- (BOOL)accessibilityIsIgnored;
- (id)accessibilityFocusedUIElement;

// attributes
- (NSArray*)accessibilityAttributeNames;
- (id)accessibilityAttributeValue:(NSString*)attribute;
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute;

// actions
- (NSArray*)accessibilityActionNames;
- (NSString*)accessibilityActionDescription:(NSString*)action;
- (void)accessibilityPerformAction:(NSString*)action;

I support no actions, and no settable attributes. Here are the attributes I support:

NSAccessibilityChildrenAttribute
NSAccessibilityParentAttribute
NSAccessibilityRoleAttribute
NSAccessibilitySubroleAttribute
NSAccessibilityRoleDescriptionAttribute
NSAccessibilityFocusedAttribute
NSAccessibilitySizeAttribute
NSAccessibilityPositionAttribute
NSAccessibilityWindowAttribute

AFAICS, I support all that are listed as mandatory in the API reference, and even some more.

I wish NSAccessibility had more stricts requirements. Right now I more or less have to guess what's missing or what's wrong.

Now and then, at the most, I get a NSException about some attribute in the Xcode debugger, but unfortunately it provides no information about what attribute emitted the error.

Any tips, or ideas are most welcome.

Regards,
Håkan Waara _______________________________________________
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

--------------------------------------------------
James Dempsey
AppKit Engineering
Apple





--------------------------------------------------
James Dempsey
AppKit Engineering
Apple



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/accessibility-dev/email@hidden

This email sent to email@hidden

References: 
 >Minimum requirements for a NSAccessibility object? (From: Håkan Waara <email@hidden>)
 >Re: Minimum requirements for a NSAccessibility object? (From: James Dempsey <email@hidden>)
 >Re: Minimum requirements for a NSAccessibility object? (From: Håkan Waara <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.