3
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
9
* - Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
12
* - Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
16
* - Neither the name of Oracle nor the names of its
17
* contributors may be used to endorse or promote products derived
18
* from this software without specific prior written permission.
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
* Wrapper functions around calls to the AccessBridge DLL
42
//#define ACCESSBRIDGE_32
43
//#define ACCESSBRIDGE_64
45
#include "AccessBridgeCalls.h"
51
HINSTANCE theAccessBridgeInstance;
52
AccessBridgeFPs theAccessBridge;
54
BOOL theAccessBridgeInitializedFlag = FALSE;
56
#define LOAD_FP(result, type, name) \
57
if ((theAccessBridge.result = \
58
(type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \
62
BOOL initializeAccessBridge() {
64
#ifdef ACCESSBRIDGE_ARCH_32 // For 32 bit AT interfacing with Java on 64 bit OS
65
theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32");
67
#ifdef ACCESSBRIDGE_ARCH_64 // For 64 bit AT interfacing with Java on 64 bit OS
68
theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64");
69
#else // For 32 bit AT interfacing with Java on 32 bit OS
70
theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE");
73
if (theAccessBridgeInstance != 0) {
74
LOAD_FP(Windows_run, Windows_runFP, "Windows_run");
76
LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP");
77
LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP");
78
LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP");
80
LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP");
82
LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP");
83
LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP");
84
LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP");
85
LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP");
86
LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP");
88
LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP");
89
LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP");
90
LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP");
91
LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP");
92
LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP");
93
LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP");
95
LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP");
96
LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP");
97
LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP");
98
LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP");
99
LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP");
100
LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP");
101
LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP");
102
LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP");
103
LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP");
104
LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP");
106
LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP");
108
LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject");
109
LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo");
111
LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow");
112
LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject");
113
LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND");
114
LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext");
116
LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt");
117
LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus");
118
LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo");
119
LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext");
120
LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext");
122
/* begin AccessibleTable */
123
LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo");
124
LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo");
126
LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader");
127
LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader");
129
LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription");
130
LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription");
132
LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP,
133
"getAccessibleTableRowSelectionCount");
134
LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP,
135
"isAccessibleTableRowSelected");
136
LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP,
137
"getAccessibleTableRowSelections");
139
LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP,
140
"getAccessibleTableColumnSelectionCount");
141
LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP,
142
"isAccessibleTableColumnSelected");
143
LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP,
144
"getAccessibleTableColumnSelections");
146
LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP,
147
"getAccessibleTableRow");
148
LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP,
149
"getAccessibleTableColumn");
150
LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP,
151
"getAccessibleTableIndex");
153
/* end AccessibleTable */
155
/* AccessibleRelationSet */
156
LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet");
158
/* AccessibleHypertext */
159
LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext");
160
LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink");
161
LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount");
162
LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt");
163
LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex");
164
LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink");
166
/* Accessible KeyBinding, Icon and Action */
167
LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings");
168
LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons");
169
LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions");
170
LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions");
173
LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo");
174
LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems");
175
LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo");
176
LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes");
177
LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect");
178
LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds");
179
LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange");
181
LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext");
182
LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext");
183
LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext");
185
LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext");
186
LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext");
187
LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext");
188
LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext");
189
LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext");
190
LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext");
191
LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext");
193
LOAD_FP(setTextContents, setTextContentsFP, "setTextContents");
194
LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole");
195
LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject");
196
LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot");
197
LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth");
198
LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent");
200
// additional methods for Teton
201
LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName");
202
LOAD_FP(requestFocus, requestFocusFP, "requestFocus");
203
LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange");
204
LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange");
205
LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount");
206
LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren");
207
LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition");
208
LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation");
210
LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting");
212
theAccessBridge.Windows_run();
214
theAccessBridgeInitializedFlag = TRUE;
222
BOOL shutdownAccessBridge() {
225
theAccessBridgeInitializedFlag = FALSE;
226
if (theAccessBridgeInstance != (HANDLE) 0) {
227
result = FreeLibrary(theAccessBridgeInstance);
228
if (result != TRUE) {
229
error = GetLastError();
237
void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) {
238
if (theAccessBridgeInitializedFlag == TRUE) {
239
theAccessBridge.SetJavaShutdown(fp);
243
void SetFocusGained(AccessBridge_FocusGainedFP fp) {
244
if (theAccessBridgeInitializedFlag == TRUE) {
245
theAccessBridge.SetFocusGained(fp);
249
void SetFocusLost(AccessBridge_FocusLostFP fp) {
250
if (theAccessBridgeInitializedFlag == TRUE) {
251
theAccessBridge.SetFocusLost(fp);
256
void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) {
257
if (theAccessBridgeInitializedFlag == TRUE) {
258
theAccessBridge.SetCaretUpdate(fp);
263
void SetMouseClicked(AccessBridge_MouseClickedFP fp) {
264
if (theAccessBridgeInitializedFlag == TRUE) {
265
theAccessBridge.SetMouseClicked(fp);
269
void SetMouseEntered(AccessBridge_MouseEnteredFP fp) {
270
if (theAccessBridgeInitializedFlag == TRUE) {
271
theAccessBridge.SetMouseEntered(fp);
275
void SetMouseExited(AccessBridge_MouseExitedFP fp) {
276
if (theAccessBridgeInitializedFlag == TRUE) {
277
theAccessBridge.SetMouseExited(fp);
281
void SetMousePressed(AccessBridge_MousePressedFP fp) {
282
if (theAccessBridgeInitializedFlag == TRUE) {
283
theAccessBridge.SetMousePressed(fp);
287
void SetMouseReleased(AccessBridge_MouseReleasedFP fp) {
288
if (theAccessBridgeInitializedFlag == TRUE) {
289
theAccessBridge.SetMouseReleased(fp);
294
void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) {
295
if (theAccessBridgeInitializedFlag == TRUE) {
296
theAccessBridge.SetMenuCanceled(fp);
300
void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) {
301
if (theAccessBridgeInitializedFlag == TRUE) {
302
theAccessBridge.SetMenuDeselected(fp);
306
void SetMenuSelected(AccessBridge_MenuSelectedFP fp) {
307
if (theAccessBridgeInitializedFlag == TRUE) {
308
theAccessBridge.SetMenuSelected(fp);
312
void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) {
313
if (theAccessBridgeInitializedFlag == TRUE) {
314
theAccessBridge.SetPopupMenuCanceled(fp);
318
void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) {
319
if (theAccessBridgeInitializedFlag == TRUE) {
320
theAccessBridge.SetPopupMenuWillBecomeInvisible(fp);
324
void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) {
325
if (theAccessBridgeInitializedFlag == TRUE) {
326
theAccessBridge.SetPopupMenuWillBecomeVisible(fp);
331
void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) {
332
if (theAccessBridgeInitializedFlag == TRUE) {
333
theAccessBridge.SetPropertyNameChange(fp);
337
void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) {
338
if (theAccessBridgeInitializedFlag == TRUE) {
339
theAccessBridge.SetPropertyDescriptionChange(fp);
343
void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) {
344
if (theAccessBridgeInitializedFlag == TRUE) {
345
theAccessBridge.SetPropertyStateChange(fp);
349
void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) {
350
if (theAccessBridgeInitializedFlag == TRUE) {
351
theAccessBridge.SetPropertyValueChange(fp);
355
void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) {
356
if (theAccessBridgeInitializedFlag == TRUE) {
357
theAccessBridge.SetPropertySelectionChange(fp);
361
void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) {
362
if (theAccessBridgeInitializedFlag == TRUE) {
363
theAccessBridge.SetPropertyTextChange(fp);
367
void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) {
368
if (theAccessBridgeInitializedFlag == TRUE) {
369
theAccessBridge.SetPropertyCaretChange(fp);
373
void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) {
374
if (theAccessBridgeInitializedFlag == TRUE) {
375
theAccessBridge.SetPropertyVisibleDataChange(fp);
379
void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) {
380
if (theAccessBridgeInitializedFlag == TRUE) {
381
theAccessBridge.SetPropertyChildChange(fp);
385
void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) {
386
if (theAccessBridgeInitializedFlag == TRUE) {
387
theAccessBridge.SetPropertyActiveDescendentChange(fp);
391
void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) {
392
if (theAccessBridgeInitializedFlag == TRUE) {
393
theAccessBridge.SetPropertyTableModelChange(fp);
400
void ReleaseJavaObject(long vmID, Java_Object object) {
401
if (theAccessBridgeInitializedFlag == TRUE) {
402
theAccessBridge.ReleaseJavaObject(vmID, object);
406
BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
407
if (theAccessBridgeInitializedFlag == TRUE) {
408
return theAccessBridge.GetVersionInfo(vmID, info);
417
BOOL IsJavaWindow(HWND window) {
418
if (theAccessBridgeInitializedFlag == TRUE) {
420
ret = theAccessBridge.IsJavaWindow(window);
429
* Returns the virtual machine ID and AccessibleContext for a top-level window
431
BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) {
432
if (theAccessBridgeInitializedFlag == TRUE) {
433
return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac);
439
* Returns the HWND from the AccessibleContext of a top-level window. Returns 0
440
* on error or if the AccessibleContext does not refer to a top-level window.
442
HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) {
443
if (theAccessBridgeInitializedFlag == TRUE) {
444
return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext);
450
* returns whether two objects are the same
452
BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
453
if (theAccessBridgeInitializedFlag == TRUE) {
454
return theAccessBridge.IsSameObject(vmID, obj1, obj2);
460
* Sets editable text contents. The AccessibleContext must implement AccessibleEditableText and
461
* be editable. The maximum text length is MAX_STRING_SIZE - 1.
462
* Returns whether successful
464
BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) {
466
if (theAccessBridgeInitializedFlag == TRUE) {
467
return theAccessBridge.setTextContents(vmID, accessibleContext, text);
473
* Returns the Accessible Context with the specified role that is the
474
* ancestor of a given object. The role is one of the role strings
475
* defined in AccessBridgePackages.h
476
* If there is no ancestor object that has the specified role,
477
* returns (AccessibleContext)0.
479
AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
480
const wchar_t *role) {
482
if (theAccessBridgeInitializedFlag == TRUE) {
483
return theAccessBridge.getParentWithRole(vmID, accessibleContext, role);
485
return (AccessibleContext)0;
489
* Returns the Accessible Context with the specified role that is the
490
* ancestor of a given object. The role is one of the role strings
491
* defined in AccessBridgePackages.h. If an object with the specified
492
* role does not exist, returns the top level object for the Java Window.
493
* Returns (AccessibleContext)0 on error.
495
AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
496
const wchar_t *role) {
498
if (theAccessBridgeInitializedFlag == TRUE) {
499
return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role);
501
return (AccessibleContext)0;
505
* Returns the Accessible Context for the top level object in
506
* a Java Window. This is same Accessible Context that is obtained
507
* from GetAccessibleContextFromHWND for that window. Returns
508
* (AccessibleContext)0 on error.
510
AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
512
if (theAccessBridgeInitializedFlag == TRUE) {
513
return theAccessBridge.getTopLevelObject(vmID, accessibleContext);
515
return (AccessibleContext)0;
519
* Returns how deep in the object hierarchy a given object is.
520
* The top most object in the object hierarchy has an object depth of 0.
521
* Returns -1 on error.
523
int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
525
if (theAccessBridgeInitializedFlag == TRUE) {
526
return theAccessBridge.getObjectDepth(vmID, accessibleContext);
532
* Returns the Accessible Context of the current ActiveDescendent of an object.
533
* This method assumes the ActiveDescendent is the component that is currently
534
* selected in a container object.
535
* Returns (AccessibleContext)0 on error or if there is no selection.
537
AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
539
if (theAccessBridgeInitializedFlag == TRUE) {
540
return theAccessBridge.getActiveDescendent(vmID, accessibleContext);
542
return (AccessibleContext)0;
547
* Accessible Context routines
549
BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent,
550
jint x, jint y, AccessibleContext *ac) {
551
if (theAccessBridgeInitializedFlag == TRUE) {
552
return theAccessBridge.GetAccessibleContextAt(vmID, acParent, x, y, ac);
557
BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) {
558
if (theAccessBridgeInitializedFlag == TRUE) {
559
return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac);
564
BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) {
565
if (theAccessBridgeInitializedFlag == TRUE) {
566
return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info);
571
AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
572
if (theAccessBridgeInitializedFlag == TRUE) {
573
return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
575
return (AccessibleContext) 0;
578
AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) {
579
if (theAccessBridgeInitializedFlag == TRUE) {
580
return theAccessBridge.GetAccessibleParentFromContext(vmID, ac);
582
return (AccessibleContext) 0;
585
/* begin AccessibleTable routines */
588
* get information about an AccessibleTable
590
BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
591
if (theAccessBridgeInitializedFlag == TRUE) {
592
return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo);
598
* get information about an AccessibleTable cell
600
BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable,
601
jint row, jint column, AccessibleTableCellInfo *tableCellInfo) {
602
if (theAccessBridgeInitializedFlag == TRUE) {
603
return theAccessBridge.getAccessibleTableCellInfo(vmID, accessibleTable, row, column, tableCellInfo);
609
* get information about an AccessibleTable row header
611
BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
612
if (theAccessBridgeInitializedFlag == TRUE) {
613
return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo);
619
* get information about an AccessibleTable column header
621
BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
623
if (theAccessBridgeInitializedFlag == TRUE) {
624
return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo);
630
* return a description of an AccessibleTable row header
632
AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) {
633
if (theAccessBridgeInitializedFlag == TRUE) {
634
return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row);
636
return (AccessibleContext)0;
640
* return a description of an AccessibleTable column header
642
AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) {
643
if (theAccessBridgeInitializedFlag == TRUE) {
644
return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column);
646
return (AccessibleContext)0;
650
* return the number of rows selected in an AccessibleTable
652
jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) {
653
if (theAccessBridgeInitializedFlag == TRUE) {
654
return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table);
660
* return whether a row is selected in an AccessibleTable
662
BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) {
663
if (theAccessBridgeInitializedFlag == TRUE) {
664
return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row);
670
* get an array of selected rows in an AccessibleTable
672
BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
673
if (theAccessBridgeInitializedFlag == TRUE) {
674
return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections);
680
* return the number of columns selected in an AccessibleTable
682
jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) {
683
if (theAccessBridgeInitializedFlag == TRUE) {
684
return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table);
690
* return whether a column is selected in an AccessibleTable
692
BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) {
693
if (theAccessBridgeInitializedFlag == TRUE) {
694
return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column);
700
* get an array of columns selected in an AccessibleTable
702
BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
703
if (theAccessBridgeInitializedFlag == TRUE) {
704
return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections);
710
* return the row number for a cell at a given index
713
getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
714
if (theAccessBridgeInitializedFlag == TRUE) {
715
return theAccessBridge.getAccessibleTableRow(vmID, table, index);
721
* return the column number for a cell at a given index
724
getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
725
if (theAccessBridgeInitializedFlag == TRUE) {
726
return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
732
* return the index of a cell at a given row and column
735
getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) {
736
if (theAccessBridgeInitializedFlag == TRUE) {
737
return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column);
742
/* end AccessibleTable routines */
746
* Accessible Text routines
748
BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y) {
749
if (theAccessBridgeInitializedFlag == TRUE) {
750
return theAccessBridge.GetAccessibleTextInfo(vmID, at, textInfo, x, y);
755
BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
756
if (theAccessBridgeInitializedFlag == TRUE) {
757
return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
762
BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) {
763
if (theAccessBridgeInitializedFlag == TRUE) {
764
return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection);
769
BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
770
if (theAccessBridgeInitializedFlag == TRUE) {
771
return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
776
BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
777
if (theAccessBridgeInitializedFlag == TRUE) {
778
return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
783
BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) {
784
if (theAccessBridgeInitializedFlag == TRUE) {
785
return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex);
790
BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len) {
791
if (theAccessBridgeInitializedFlag == TRUE) {
792
return theAccessBridge.GetAccessibleTextRange(vmID, at, start, end, text, len);
798
* AccessibleRelationSet routines
800
BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
801
AccessibleRelationSetInfo *relationSetInfo) {
802
if (theAccessBridgeInitializedFlag == TRUE) {
803
return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
809
* AccessibleHypertext routines
812
// Gets AccessibleHypertext for an AccessibleContext
813
BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext,
814
AccessibleHypertextInfo *hypertextInfo) {
815
if (theAccessBridgeInitializedFlag == TRUE) {
816
return theAccessBridge.getAccessibleHypertext(vmID, accessibleContext, hypertextInfo);
821
// Activates an AccessibleHyperlink for an AccessibleContext
822
BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext,
823
AccessibleHyperlink accessibleHyperlink) {
824
if (theAccessBridgeInitializedFlag == TRUE) {
825
return theAccessBridge.activateAccessibleHyperlink(vmID, accessibleContext, accessibleHyperlink);
831
* Returns the number of hyperlinks in a component
832
* Maps to AccessibleHypertext.getLinkCount.
833
* Returns -1 on error.
835
jint getAccessibleHyperlinkCount(const long vmID,
836
const AccessibleContext accessibleContext) {
838
if (theAccessBridgeInitializedFlag == TRUE) {
839
return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext);
845
* This method is used to iterate through the hyperlinks in a component. It
846
* returns hypertext information for a component starting at hyperlink index
847
* nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
848
* be returned for each call to this method.
849
* returns FALSE on error.
851
BOOL getAccessibleHypertextExt(const long vmID,
852
const AccessibleContext accessibleContext,
853
const jint nStartIndex,
854
/* OUT */ AccessibleHypertextInfo *hypertextInfo) {
856
if (theAccessBridgeInitializedFlag == TRUE) {
857
return theAccessBridge.getAccessibleHypertextExt(vmID,
866
* Returns the index into an array of hyperlinks that is associated with
867
* a character index in document;
868
* Maps to AccessibleHypertext.getLinkIndex.
869
* Returns -1 on error.
871
jint getAccessibleHypertextLinkIndex(const long vmID,
872
const AccessibleHypertext hypertext,
875
if (theAccessBridgeInitializedFlag == TRUE) {
876
return theAccessBridge.getAccessibleHypertextLinkIndex(vmID,
884
* Returns the nth hyperlink in a document.
885
* Maps to AccessibleHypertext.getLink.
886
* Returns -1 on error
888
BOOL getAccessibleHyperlink(const long vmID,
889
const AccessibleHypertext hypertext,
891
/* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
893
if (theAccessBridgeInitializedFlag == TRUE) {
894
return theAccessBridge.getAccessibleHyperlink(vmID,
903
/* Accessible KeyBindings, Icons and Actions */
904
BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext,
905
AccessibleKeyBindings *keyBindings) {
906
if (theAccessBridgeInitializedFlag == TRUE) {
907
return theAccessBridge.getAccessibleKeyBindings(vmID, accessibleContext, keyBindings);
912
BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
913
AccessibleIcons *icons) {
914
if (theAccessBridgeInitializedFlag == TRUE) {
915
return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons);
920
BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
921
AccessibleActions *actions) {
922
if (theAccessBridgeInitializedFlag == TRUE) {
923
return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions);
928
BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
929
AccessibleActionsToDo *actionsToDo, jint *failure) {
930
if (theAccessBridgeInitializedFlag == TRUE) {
931
return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure);
937
* Accessible Value routines
939
BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
940
if (theAccessBridgeInitializedFlag == TRUE) {
941
return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len);
946
BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
947
if (theAccessBridgeInitializedFlag == TRUE) {
948
return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len);
953
BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
954
if (theAccessBridgeInitializedFlag == TRUE) {
955
return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len);
962
* Accessible Selection routines
964
void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
965
if (theAccessBridgeInitializedFlag == TRUE) {
966
theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i);
970
void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
971
if (theAccessBridgeInitializedFlag == TRUE) {
972
theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as);
976
JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
977
if (theAccessBridgeInitializedFlag == TRUE) {
978
return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i);
980
return (JOBJECT64) 0;
983
int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) {
984
if (theAccessBridgeInitializedFlag == TRUE) {
985
return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as);
990
BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) {
991
if (theAccessBridgeInitializedFlag == TRUE) {
992
return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i);
997
void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
998
if (theAccessBridgeInitializedFlag == TRUE) {
999
theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i);
1003
void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
1004
if (theAccessBridgeInitializedFlag == TRUE) {
1005
theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as);
1010
* Additional methods for Teton
1014
* Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
1015
* whether successful.
1017
* Bug ID 4916682 - Implement JAWS AccessibleName policy
1019
BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext,
1020
wchar_t *name, int len) {
1021
if (theAccessBridgeInitializedFlag == TRUE) {
1022
return theAccessBridge.getVirtualAccessibleName(vmID, accessibleContext, name, len);
1028
* Request focus for a component. Returns whether successful;
1030
* Bug ID 4944757 - requestFocus method needed
1032
BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) {
1033
if (theAccessBridgeInitializedFlag == TRUE) {
1034
return theAccessBridge.requestFocus(vmID, accessibleContext);
1040
* Selects text between two indices. Selection includes the text at the start index
1041
* and the text at the end index. Returns whether successful;
1043
* Bug ID 4944758 - selectTextRange method needed
1045
BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext,
1046
const int startIndex, const int endIndex) {
1047
if (theAccessBridgeInitializedFlag == TRUE) {
1048
return theAccessBridge.selectTextRange(vmID, accessibleContext, startIndex, endIndex);
1054
* Get text attributes between two indices. The attribute list includes the text at the
1055
* start index and the text at the end index. Returns whether successful;
1057
* Bug ID 4944761 - getTextAttributes between two indices method needed
1059
BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext,
1060
const int startIndex, const int endIndex,
1061
AccessibleTextAttributesInfo *attributes, short *len) {
1062
if (theAccessBridgeInitializedFlag == TRUE) {
1063
return theAccessBridge.getTextAttributesInRange(vmID, accessibleContext, startIndex,
1064
endIndex, attributes, len);
1070
* Returns the number of visible children of a component. Returns -1 on error.
1072
* Bug ID 4944762- getVisibleChildren for list-like components needed
1074
int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) {
1075
if (theAccessBridgeInitializedFlag == TRUE) {
1076
return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext);
1082
* Gets the visible children of an AccessibleContext. Returns whether successful;
1084
* Bug ID 4944762- getVisibleChildren for list-like components needed
1086
BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext,
1087
const int startIndex, VisibleChildrenInfo *visibleChildrenInfo) {
1088
if (theAccessBridgeInitializedFlag == TRUE) {
1089
return theAccessBridge.getVisibleChildren(vmID, accessibleContext, startIndex,
1090
visibleChildrenInfo);
1096
* Set the caret to a text position. Returns whether successful;
1098
* Bug ID 4944770 - setCaretPosition method needed
1100
BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
1101
const int position) {
1102
if (theAccessBridgeInitializedFlag == TRUE) {
1103
return theAccessBridge.setCaretPosition(vmID, accessibleContext, position);
1109
* Gets the text caret location
1111
BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
1112
if (theAccessBridgeInitializedFlag == TRUE) {
1113
return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
1119
* Gets the number of events waiting to fire
1121
int getEventsWaiting() {
1122
if (theAccessBridgeInitializedFlag == TRUE) {
1123
return theAccessBridge.getEventsWaiting();