jdk

Форк
0
1130 строк · 45.0 Кб
1
/*
2
 *
3
 * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 *
9
 *   - Redistributions of source code must retain the above copyright
10
 *     notice, this list of conditions and the following disclaimer.
11
 *
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.
15
 *
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.
19
 *
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.
31
 */
32

33
/*
34
 * Wrapper functions around calls to the AccessBridge DLL
35
 */
36

37

38
#include <windows.h>
39
#include <jni.h>
40

41

42
//#define ACCESSBRIDGE_32
43
//#define ACCESSBRIDGE_64
44

45
#include "AccessBridgeCalls.h"
46

47
#ifdef __cplusplus
48
extern "C" {
49
#endif
50

51
    HINSTANCE theAccessBridgeInstance;
52
    AccessBridgeFPs theAccessBridge;
53

54
    BOOL theAccessBridgeInitializedFlag = FALSE;
55

56
#define LOAD_FP(result, type, name) \
57
    if ((theAccessBridge.result = \
58
        (type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \
59
        return FALSE; \
60
    }
61

62
    BOOL initializeAccessBridge() {
63

64
#ifdef ACCESSBRIDGE_ARCH_32 // For 32 bit AT interfacing with Java on 64 bit OS
65
        theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32");
66
#else
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");
71
#endif
72
#endif
73
        if (theAccessBridgeInstance != 0) {
74
            LOAD_FP(Windows_run, Windows_runFP, "Windows_run");
75

76
            LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP");
77
            LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP");
78
            LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP");
79

80
            LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP");
81

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");
87

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");
94

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");
105

106
            LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP");
107

108
            LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject");
109
            LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo");
110

111
            LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow");
112
            LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject");
113
            LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND");
114
            LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext");
115

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");
121

122
            /* begin AccessibleTable */
123
            LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo");
124
            LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo");
125

126
            LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader");
127
            LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader");
128

129
            LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription");
130
            LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription");
131

132
            LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP,
133
                    "getAccessibleTableRowSelectionCount");
134
            LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP,
135
                    "isAccessibleTableRowSelected");
136
            LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP,
137
                    "getAccessibleTableRowSelections");
138

139
            LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP,
140
                    "getAccessibleTableColumnSelectionCount");
141
            LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP,
142
                    "isAccessibleTableColumnSelected");
143
            LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP,
144
                    "getAccessibleTableColumnSelections");
145

146
            LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP,
147
                    "getAccessibleTableRow");
148
            LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP,
149
                    "getAccessibleTableColumn");
150
            LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP,
151
                    "getAccessibleTableIndex");
152

153
            /* end AccessibleTable */
154

155
            /* AccessibleRelationSet */
156
            LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet");
157

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");
165

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");
171

172
            /* AccessibleText */
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");
180

181
            LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext");
182
            LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext");
183
            LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext");
184

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");
192

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");
199

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");
209

210
            LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting");
211

212
            theAccessBridge.Windows_run();
213

214
            theAccessBridgeInitializedFlag = TRUE;
215
            return TRUE;
216
        } else {
217
            return FALSE;
218
        }
219
    }
220

221

222
    BOOL shutdownAccessBridge() {
223
        BOOL result;
224
        DWORD error;
225
        theAccessBridgeInitializedFlag = FALSE;
226
        if (theAccessBridgeInstance != (HANDLE) 0) {
227
            result = FreeLibrary(theAccessBridgeInstance);
228
            if (result != TRUE) {
229
                error = GetLastError();
230
            }
231
            return TRUE;
232
        }
233
        return FALSE;
234
    }
235

236

237
    void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) {
238
        if (theAccessBridgeInitializedFlag == TRUE) {
239
            theAccessBridge.SetJavaShutdown(fp);
240
        }
241
    }
242

243
    void SetFocusGained(AccessBridge_FocusGainedFP fp) {
244
        if (theAccessBridgeInitializedFlag == TRUE) {
245
            theAccessBridge.SetFocusGained(fp);
246
        }
247
    }
248

249
    void SetFocusLost(AccessBridge_FocusLostFP fp) {
250
        if (theAccessBridgeInitializedFlag == TRUE) {
251
            theAccessBridge.SetFocusLost(fp);
252
        }
253
    }
254

255

256
    void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) {
257
        if (theAccessBridgeInitializedFlag == TRUE) {
258
            theAccessBridge.SetCaretUpdate(fp);
259
        }
260
    }
261

262

263
    void SetMouseClicked(AccessBridge_MouseClickedFP fp) {
264
        if (theAccessBridgeInitializedFlag == TRUE) {
265
            theAccessBridge.SetMouseClicked(fp);
266
        }
267
    }
268

269
    void SetMouseEntered(AccessBridge_MouseEnteredFP fp) {
270
        if (theAccessBridgeInitializedFlag == TRUE) {
271
            theAccessBridge.SetMouseEntered(fp);
272
        }
273
    }
274

275
    void SetMouseExited(AccessBridge_MouseExitedFP fp) {
276
        if (theAccessBridgeInitializedFlag == TRUE) {
277
            theAccessBridge.SetMouseExited(fp);
278
        }
279
    }
280

281
    void SetMousePressed(AccessBridge_MousePressedFP fp) {
282
        if (theAccessBridgeInitializedFlag == TRUE) {
283
            theAccessBridge.SetMousePressed(fp);
284
        }
285
    }
286

287
    void SetMouseReleased(AccessBridge_MouseReleasedFP fp) {
288
        if (theAccessBridgeInitializedFlag == TRUE) {
289
            theAccessBridge.SetMouseReleased(fp);
290
        }
291
    }
292

293

294
    void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) {
295
        if (theAccessBridgeInitializedFlag == TRUE) {
296
            theAccessBridge.SetMenuCanceled(fp);
297
        }
298
    }
299

300
    void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) {
301
        if (theAccessBridgeInitializedFlag == TRUE) {
302
            theAccessBridge.SetMenuDeselected(fp);
303
        }
304
    }
305

306
    void SetMenuSelected(AccessBridge_MenuSelectedFP fp) {
307
        if (theAccessBridgeInitializedFlag == TRUE) {
308
            theAccessBridge.SetMenuSelected(fp);
309
        }
310
    }
311

312
    void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) {
313
        if (theAccessBridgeInitializedFlag == TRUE) {
314
            theAccessBridge.SetPopupMenuCanceled(fp);
315
        }
316
    }
317

318
    void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) {
319
        if (theAccessBridgeInitializedFlag == TRUE) {
320
            theAccessBridge.SetPopupMenuWillBecomeInvisible(fp);
321
        }
322
    }
323

324
    void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) {
325
        if (theAccessBridgeInitializedFlag == TRUE) {
326
            theAccessBridge.SetPopupMenuWillBecomeVisible(fp);
327
        }
328
    }
329

330

331
    void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) {
332
        if (theAccessBridgeInitializedFlag == TRUE) {
333
            theAccessBridge.SetPropertyNameChange(fp);
334
        }
335
    }
336

337
    void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) {
338
        if (theAccessBridgeInitializedFlag == TRUE) {
339
            theAccessBridge.SetPropertyDescriptionChange(fp);
340
        }
341
    }
342

343
    void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) {
344
        if (theAccessBridgeInitializedFlag == TRUE) {
345
            theAccessBridge.SetPropertyStateChange(fp);
346
        }
347
    }
348

349
    void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) {
350
        if (theAccessBridgeInitializedFlag == TRUE) {
351
            theAccessBridge.SetPropertyValueChange(fp);
352
        }
353
    }
354

355
    void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) {
356
        if (theAccessBridgeInitializedFlag == TRUE) {
357
            theAccessBridge.SetPropertySelectionChange(fp);
358
        }
359
    }
360

361
    void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) {
362
        if (theAccessBridgeInitializedFlag == TRUE) {
363
            theAccessBridge.SetPropertyTextChange(fp);
364
        }
365
    }
366

367
    void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) {
368
        if (theAccessBridgeInitializedFlag == TRUE) {
369
            theAccessBridge.SetPropertyCaretChange(fp);
370
        }
371
    }
372

373
    void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) {
374
        if (theAccessBridgeInitializedFlag == TRUE) {
375
            theAccessBridge.SetPropertyVisibleDataChange(fp);
376
        }
377
    }
378

379
    void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) {
380
        if (theAccessBridgeInitializedFlag == TRUE) {
381
            theAccessBridge.SetPropertyChildChange(fp);
382
        }
383
    }
384

385
    void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) {
386
        if (theAccessBridgeInitializedFlag == TRUE) {
387
            theAccessBridge.SetPropertyActiveDescendentChange(fp);
388
        }
389
    }
390

391
    void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) {
392
        if (theAccessBridgeInitializedFlag == TRUE) {
393
            theAccessBridge.SetPropertyTableModelChange(fp);
394
        }
395
    }
396

397
    /**
398
     * General routines
399
     */
400
    void ReleaseJavaObject(long vmID, Java_Object object) {
401
        if (theAccessBridgeInitializedFlag == TRUE) {
402
            theAccessBridge.ReleaseJavaObject(vmID, object);
403
        }
404
    }
405

406
    BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
407
        if (theAccessBridgeInitializedFlag == TRUE) {
408
            return theAccessBridge.GetVersionInfo(vmID, info);
409
        }
410
        return FALSE;
411
    }
412

413

414
    /**
415
     * Window routines
416
     */
417
    BOOL IsJavaWindow(HWND window) {
418
        if (theAccessBridgeInitializedFlag == TRUE) {
419
                        BOOL ret ;
420
                        ret = theAccessBridge.IsJavaWindow(window);
421
            return ret ;
422

423
        }
424
        return FALSE;
425
    }
426

427

428
    /**
429
     * Returns the virtual machine ID and AccessibleContext for a top-level window
430
     */
431
    BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) {
432
        if (theAccessBridgeInitializedFlag == TRUE) {
433
            return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac);
434
        }
435
        return FALSE;
436
    }
437

438
    /**
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.
441
     */
442
    HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) {
443
        if (theAccessBridgeInitializedFlag == TRUE) {
444
            return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext);
445
        }
446
        return (HWND)0;
447
    }
448

449
    /**
450
     * returns whether two objects are the same
451
     */
452
    BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
453
        if (theAccessBridgeInitializedFlag == TRUE) {
454
            return theAccessBridge.IsSameObject(vmID, obj1, obj2);
455
        }
456
        return FALSE;
457
    }
458

459
    /**
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
463
     */
464
    BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) {
465

466
        if (theAccessBridgeInitializedFlag == TRUE) {
467
            return theAccessBridge.setTextContents(vmID, accessibleContext, text);
468
        }
469
        return FALSE;
470
    }
471

472
    /**
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.
478
     */
479
    AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
480
                                         const wchar_t *role) {
481

482
        if (theAccessBridgeInitializedFlag == TRUE) {
483
            return theAccessBridge.getParentWithRole(vmID, accessibleContext, role);
484
        }
485
        return (AccessibleContext)0;
486
    }
487

488
    /**
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.
494
     */
495
    AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
496
                                                 const wchar_t *role) {
497

498
        if (theAccessBridgeInitializedFlag == TRUE) {
499
            return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role);
500
        }
501
        return (AccessibleContext)0;
502
    }
503

504
    /**
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.
509
     */
510
    AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
511

512
        if (theAccessBridgeInitializedFlag == TRUE) {
513
            return theAccessBridge.getTopLevelObject(vmID, accessibleContext);
514
        }
515
        return (AccessibleContext)0;
516
    }
517

518
    /**
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.
522
     */
523
    int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
524

525
        if (theAccessBridgeInitializedFlag == TRUE) {
526
            return theAccessBridge.getObjectDepth(vmID, accessibleContext);
527
        }
528
        return -1;
529
    }
530

531
    /**
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.
536
     */
537
    AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
538

539
        if (theAccessBridgeInitializedFlag == TRUE) {
540
            return theAccessBridge.getActiveDescendent(vmID, accessibleContext);
541
        }
542
        return (AccessibleContext)0;
543
    }
544

545

546
    /**
547
     * Accessible Context routines
548
     */
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);
553
        }
554
        return FALSE;
555
    }
556

557
    BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) {
558
        if (theAccessBridgeInitializedFlag == TRUE) {
559
            return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac);
560
        }
561
        return FALSE;
562
    }
563

564
    BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) {
565
        if (theAccessBridgeInitializedFlag == TRUE) {
566
            return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info);
567
        }
568
        return FALSE;
569
    }
570

571
    AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
572
        if (theAccessBridgeInitializedFlag == TRUE) {
573
            return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
574
        }
575
        return (AccessibleContext) 0;
576
    }
577

578
    AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) {
579
        if (theAccessBridgeInitializedFlag == TRUE) {
580
            return theAccessBridge.GetAccessibleParentFromContext(vmID, ac);
581
        }
582
        return (AccessibleContext) 0;
583
    }
584

585
    /* begin AccessibleTable routines */
586

587
    /*
588
     * get information about an AccessibleTable
589
     */
590
    BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
591
        if (theAccessBridgeInitializedFlag == TRUE) {
592
            return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo);
593
        }
594
        return FALSE;
595
    }
596

597
    /*
598
     * get information about an AccessibleTable cell
599
     */
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);
604
        }
605
        return FALSE;
606
    }
607

608
    /*
609
     * get information about an AccessibleTable row header
610
     */
611
    BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
612
        if (theAccessBridgeInitializedFlag == TRUE) {
613
            return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo);
614
        }
615
        return FALSE;
616
    }
617

618
    /*
619
     * get information about an AccessibleTable column header
620
     */
621
    BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
622

623
        if (theAccessBridgeInitializedFlag == TRUE) {
624
            return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo);
625
        }
626
        return FALSE;
627
    }
628

629
    /*
630
     * return a description of an AccessibleTable row header
631
     */
632
    AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) {
633
        if (theAccessBridgeInitializedFlag == TRUE) {
634
            return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row);
635
        }
636
        return (AccessibleContext)0;
637
    }
638

639
    /*
640
     * return a description of an AccessibleTable column header
641
     */
642
    AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) {
643
        if (theAccessBridgeInitializedFlag == TRUE) {
644
            return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column);
645
        }
646
        return (AccessibleContext)0;
647
    }
648

649
    /*
650
     * return the number of rows selected in an AccessibleTable
651
     */
652
    jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) {
653
        if (theAccessBridgeInitializedFlag == TRUE) {
654
            return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table);
655
        }
656
        return -1;
657
    }
658

659
    /*
660
     * return whether a row is selected in an AccessibleTable
661
     */
662
    BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) {
663
        if (theAccessBridgeInitializedFlag == TRUE) {
664
            return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row);
665
        }
666
        return FALSE;
667
    }
668

669
    /*
670
     * get an array of selected rows in an AccessibleTable
671
     */
672
    BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
673
        if (theAccessBridgeInitializedFlag == TRUE) {
674
            return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections);
675
        }
676
        return FALSE;
677
    }
678

679
    /*
680
     * return the number of columns selected in an AccessibleTable
681
     */
682
    jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) {
683
        if (theAccessBridgeInitializedFlag == TRUE) {
684
            return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table);
685
        }
686
        return -1;
687
    }
688

689
    /*
690
     * return whether a column is selected in an AccessibleTable
691
     */
692
    BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) {
693
        if (theAccessBridgeInitializedFlag == TRUE) {
694
            return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column);
695
        }
696
        return FALSE;
697
    }
698

699
    /*
700
     * get an array of columns selected in an AccessibleTable
701
     */
702
    BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
703
        if (theAccessBridgeInitializedFlag == TRUE) {
704
            return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections);
705
        }
706
        return FALSE;
707
    }
708

709
    /*
710
     * return the row number for a cell at a given index
711
     */
712
    jint
713
    getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
714
        if (theAccessBridgeInitializedFlag == TRUE) {
715
            return theAccessBridge.getAccessibleTableRow(vmID, table, index);
716
        }
717
        return -1;
718
    }
719

720
    /*
721
     * return the column number for a cell at a given index
722
     */
723
    jint
724
    getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
725
        if (theAccessBridgeInitializedFlag == TRUE) {
726
            return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
727
        }
728
        return -1;
729
    }
730

731
    /*
732
     * return the index of a cell at a given row and column
733
     */
734
    jint
735
    getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) {
736
        if (theAccessBridgeInitializedFlag == TRUE) {
737
            return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column);
738
        }
739
        return -1;
740
    }
741

742
    /* end AccessibleTable routines */
743

744

745
    /**
746
     * Accessible Text routines
747
     */
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);
751
        }
752
        return FALSE;
753
    }
754

755
    BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
756
        if (theAccessBridgeInitializedFlag == TRUE) {
757
            return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
758
        }
759
        return FALSE;
760
    }
761

762
    BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) {
763
        if (theAccessBridgeInitializedFlag == TRUE) {
764
            return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection);
765
        }
766
        return FALSE;
767
    }
768

769
    BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
770
        if (theAccessBridgeInitializedFlag == TRUE) {
771
            return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
772
        }
773
        return FALSE;
774
    }
775

776
    BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
777
        if (theAccessBridgeInitializedFlag == TRUE) {
778
            return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
779
        }
780
        return FALSE;
781
    }
782

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);
786
        }
787
        return FALSE;
788
    }
789

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);
793
        }
794
        return FALSE;
795
    }
796

797
    /**
798
     * AccessibleRelationSet routines
799
     */
800
    BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
801
                                  AccessibleRelationSetInfo *relationSetInfo) {
802
        if (theAccessBridgeInitializedFlag == TRUE) {
803
            return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
804
        }
805
        return FALSE;
806
    }
807

808
    /**
809
     * AccessibleHypertext routines
810
     */
811

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);
817
        }
818
        return FALSE;
819
    }
820

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);
826
        }
827
        return FALSE;
828
    }
829

830
    /*
831
     * Returns the number of hyperlinks in a component
832
     * Maps to AccessibleHypertext.getLinkCount.
833
     * Returns -1 on error.
834
     */
835
    jint getAccessibleHyperlinkCount(const long vmID,
836
                                     const AccessibleContext accessibleContext) {
837

838
        if (theAccessBridgeInitializedFlag == TRUE) {
839
            return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext);
840
        }
841
        return -1;
842
    }
843

844
    /*
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.
850
     */
851
    BOOL getAccessibleHypertextExt(const long vmID,
852
                                   const AccessibleContext accessibleContext,
853
                                   const jint nStartIndex,
854
                                   /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
855

856
        if (theAccessBridgeInitializedFlag == TRUE) {
857
            return theAccessBridge.getAccessibleHypertextExt(vmID,
858
                                                             accessibleContext,
859
                                                             nStartIndex,
860
                                                             hypertextInfo);
861
        }
862
        return FALSE;
863
    }
864

865
    /*
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.
870
     */
871
    jint getAccessibleHypertextLinkIndex(const long vmID,
872
                                         const AccessibleHypertext hypertext,
873
                                         const jint nIndex) {
874

875
        if (theAccessBridgeInitializedFlag == TRUE) {
876
            return theAccessBridge.getAccessibleHypertextLinkIndex(vmID,
877
                                                                   hypertext,
878
                                                                   nIndex);
879
        }
880
        return -1;
881
    }
882

883
    /*
884
     * Returns the nth hyperlink in a document.
885
     * Maps to AccessibleHypertext.getLink.
886
     * Returns -1 on error
887
     */
888
    BOOL getAccessibleHyperlink(const long vmID,
889
                                const AccessibleHypertext hypertext,
890
                                const jint nIndex,
891
                                /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
892

893
        if (theAccessBridgeInitializedFlag == TRUE) {
894
            return theAccessBridge.getAccessibleHyperlink(vmID,
895
                                                          hypertext,
896
                                                          nIndex,
897
                                                          hyperlinkInfo);
898
        }
899
        return FALSE;
900
    }
901

902

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);
908
        }
909
        return FALSE;
910
    }
911

912
    BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
913
                            AccessibleIcons *icons) {
914
        if (theAccessBridgeInitializedFlag == TRUE) {
915
            return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons);
916
        }
917
        return FALSE;
918
    }
919

920
    BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
921
                              AccessibleActions *actions) {
922
        if (theAccessBridgeInitializedFlag == TRUE) {
923
            return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions);
924
        }
925
        return FALSE;
926
    }
927

928
    BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
929
                             AccessibleActionsToDo *actionsToDo, jint *failure) {
930
        if (theAccessBridgeInitializedFlag == TRUE) {
931
            return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure);
932
        }
933
        return FALSE;
934
    }
935

936
    /**
937
     * Accessible Value routines
938
     */
939
    BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
940
        if (theAccessBridgeInitializedFlag == TRUE) {
941
            return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len);
942
        }
943
        return FALSE;
944
    }
945

946
    BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
947
        if (theAccessBridgeInitializedFlag == TRUE) {
948
            return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len);
949
        }
950
        return FALSE;
951
    }
952

953
    BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
954
        if (theAccessBridgeInitializedFlag == TRUE) {
955
            return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len);
956
        }
957
        return FALSE;
958
    }
959

960

961
    /**
962
     * Accessible Selection routines
963
     */
964
    void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
965
        if (theAccessBridgeInitializedFlag == TRUE) {
966
            theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i);
967
        }
968
    }
969

970
    void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
971
        if (theAccessBridgeInitializedFlag == TRUE) {
972
            theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as);
973
        }
974
    }
975

976
    JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
977
        if (theAccessBridgeInitializedFlag == TRUE) {
978
            return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i);
979
        }
980
        return (JOBJECT64) 0;
981
    }
982

983
    int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) {
984
        if (theAccessBridgeInitializedFlag == TRUE) {
985
            return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as);
986
        }
987
        return -1;
988
    }
989

990
    BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) {
991
        if (theAccessBridgeInitializedFlag == TRUE) {
992
            return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i);
993
        }
994
        return FALSE;
995
    }
996

997
    void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
998
        if (theAccessBridgeInitializedFlag == TRUE) {
999
            theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i);
1000
        }
1001
    }
1002

1003
    void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
1004
        if (theAccessBridgeInitializedFlag == TRUE) {
1005
            theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as);
1006
        }
1007
    }
1008

1009
    /**
1010
     * Additional methods for Teton
1011
     */
1012

1013
    /**
1014
     * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
1015
     * whether successful.
1016
     *
1017
     * Bug ID 4916682 - Implement JAWS AccessibleName policy
1018
     */
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);
1023
        }
1024
        return FALSE;
1025
    }
1026

1027
    /**
1028
     * Request focus for a component. Returns whether successful;
1029
     *
1030
     * Bug ID 4944757 - requestFocus method needed
1031
     */
1032
    BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) {
1033
        if (theAccessBridgeInitializedFlag == TRUE) {
1034
            return theAccessBridge.requestFocus(vmID, accessibleContext);
1035
        }
1036
        return FALSE;
1037
    }
1038

1039
    /**
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;
1042
     *
1043
     * Bug ID 4944758 - selectTextRange method needed
1044
     */
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);
1049
        }
1050
        return FALSE;
1051
    }
1052

1053
    /**
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;
1056
     *
1057
     * Bug ID 4944761 - getTextAttributes between two indices method needed
1058
     */
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);
1065
        }
1066
        return FALSE;
1067
    }
1068

1069
    /**
1070
     * Returns the number of visible children of a component. Returns -1 on error.
1071
     *
1072
     * Bug ID 4944762- getVisibleChildren for list-like components needed
1073
     */
1074
    int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) {
1075
        if (theAccessBridgeInitializedFlag == TRUE) {
1076
            return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext);
1077
        }
1078
        return FALSE;
1079
    }
1080

1081
    /**
1082
     * Gets the visible children of an AccessibleContext. Returns whether successful;
1083
     *
1084
     * Bug ID 4944762- getVisibleChildren for list-like components needed
1085
     */
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);
1091
        }
1092
        return FALSE;
1093
    }
1094

1095
    /**
1096
     * Set the caret to a text position. Returns whether successful;
1097
     *
1098
     * Bug ID 4944770 - setCaretPosition method needed
1099
     */
1100
    BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
1101
                          const int position) {
1102
        if (theAccessBridgeInitializedFlag == TRUE) {
1103
            return theAccessBridge.setCaretPosition(vmID, accessibleContext, position);
1104
        }
1105
        return FALSE;
1106
    }
1107

1108
    /**
1109
     * Gets the text caret location
1110
     */
1111
    BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
1112
        if (theAccessBridgeInitializedFlag == TRUE) {
1113
            return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
1114
        }
1115
        return FALSE;
1116
    }
1117

1118
    /**
1119
     * Gets the number of events waiting to fire
1120
     */
1121
    int getEventsWaiting() {
1122
        if (theAccessBridgeInitializedFlag == TRUE) {
1123
            return theAccessBridge.getEventsWaiting();
1124
        }
1125
        return FALSE;
1126
    }
1127

1128
#ifdef __cplusplus
1129
}
1130
#endif
1131

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.