Implement extend LCL TLazAccessibleObject accessibility functionality for Cocoa widgetsets.
Original Reporter info from Mantis: djenkins @dfjenkins
-
Reporter name: David Jenkins
Original Reporter info from Mantis: djenkins @dfjenkins
- Reporter name: David Jenkins
Description:
accessibility_cocoa.patch
cocoaaccessibility.pas
This is the implementation for Cocoa. It relies on a TCocoaAccessibleObject to back TLazAccessibleObject. The code for TCocoaAccessibleObject is in cocoaaccessibility.pas
Changes can be ifdef included/turned off with COCOA_ACCESSIBILITY_ENABLE define in cocoadefines.inc.
Changes outside of cocoaaccessibility.pas are to turn on accessiblity, respond to TLazAccesssibleObject.GetHandle requests, and to improve ability to define the accessiblity tree.
Cocoa widgets have accessibilty functions already builtin to them and handles passed to TWinControl can also therefore back the TLazAccessibleObjects associated with that TWinControl. TCocoaAccessibleObjects only need to be created for TLazAccessibleObjects that aren't associated with a TWinControl. Or in the case when the NSView associated with the TWinControl does not provide enough accessibility functionality. TTreeView <- TCocoaCustomControl is an example. The TCocoaCustomControl is not specific enough for the table/outline functionality needed for TTreeView. So a specialiazed TCocoaAccessibleObject is placed in to the accessiblity tree as a child.
Interface between existing NSView/TWinControl accessiblity functions and TLazAccessibleObject is allowed by including adding some accessibility functions to ICommonCallback.
Using what is in this patch I have been able to access all the lcl native objects I needed through "Accessiblity Inspector" and "Voice Over" on Mac. I have been able to add in some of our custom objects with a combination of using the existing TLazAccessibleObjects and creating object specific TCocoaAccessibleObjects.
Mantis conversion info:
- Mantis ID: 38605
- Monitored by: » MarcoZ (Marco Zehe), » @boramis (Zoë Peterson)