1 Windows Accessibility Bridge.
3 This code provides a bridge between our internal Accessibility
4 interfaces (implemented on all visible 'things' in the suite: eg.
5 windows, buttons, entry boxes etc.) - and the Windows MSAA /
6 IAccessible2 COM interfaces that are familiar to windows users and
7 Accessible Technologies (ATs) such as the NVDA screen reader.
9 The code breaks into three bits:
12 + the UNO service providing the accessibility bridge.
13 It essentially listens to events from the LibreOffice
14 core and creates and synchronises COM peers for our
15 internal accessibility objects when events arrive.
18 + COM implementations of the MSAA / IAccessible2 interfaces
19 to provide native peers for the accessibility code.
22 + COM Interface Definition Language (IDL) for UAccCom.
24 Here is one way of visualising the code / control flow
26 VCL <-> UNO toolkit <-> UNO a11y <-> win a11y <-> COM / IAccessible2
27 vcl/ <-> toolkit/ <-> accessibility/ <-> winaccessibility/ <-> UAccCom/
31 It's possible that the UNO components are called from threads other
32 than the main thread, so they have to be synchronized. It would be nice
33 to put the component into an UNO apartment (and the COM components into STA)
34 but UNO would spawn a new thread for it so it's not possible.
35 The COM components also call into the same global AccObjectWinManager
36 as the UNO components do so both have to be synchronized in the same way.
37 So we use the SolarMutex for all synchronization since anything else
38 would be rather difficult to make work. Unfortunately there is a
39 pre-existing problem in vcl with Win32 Window creation and destruction
40 on non-main threads where a synchronous SendMessage is used while
41 the SolarMutex is locked that can cause deadlocks if the main thread is
42 waiting on the SolarMutex itself at that time and thus not handing the
43 Win32 message; this is easy to trigger with JunitTests but hopefully
44 not by actual end users.
46 Debugging / playing with winaccessibility
48 If NVDA is running when soffice starts, IA2 should be automatically enabled
49 and work as expected. In order to use 'accprobe' to debug
50 it is necessary to override the check for whether an AT (like NVDA) is
51 running; to do that use:
53 SAL_FORCE_IACCESSIBLE2=1 soffice.exe -writer
55 Then you can use accprobe to introspect the accessibility hierarchy
58 http://accessibility.linuxfoundation.org/a11yweb/util/accprobe/
60 But often it's more useful to look at NVDA's text output window...