• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

inc/H03-Mar-2022-1,490595

source/H03-Mar-2022-22,65015,648

CustomTarget_ia2_idl.mkH A D03-Mar-20221.5 KiB4326

Library_uacccom.mkH A D03-Mar-20222.1 KiB8358

Library_winaccessibility.mkH A D03-Mar-20222.5 KiB8360

MakefileH A D03-Mar-2022478 152

Module_winaccessibility.mkH A D03-Mar-2022638 2411

README.mdH A D03-Mar-20222.5 KiB6345

WinResTarget_uacccom.mkH A D03-Mar-2022803 3214

README.md

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