Skip to content

Commit b5fd901

Browse files
authored
Merge 0077aec into 833bc4e
2 parents 833bc4e + 0077aec commit b5fd901

5 files changed

Lines changed: 23 additions & 19 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040
[submodule "include/py2exe"]
4141
path = include/py2exe
4242
url = https://github.com/nvaccess/py2exe-bin
43+
[submodule "include/javaAccessBridge32"]
44+
path = include/javaAccessBridge32
45+
url = https://github.com/nvaccess/javaAccessBridge32-bin.git

include/javaAccessBridge32

Submodule javaAccessBridge32 added at 130e7b0

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ For reference, the following run time dependencies are included in Git submodule
7777
* lilli.dll, version 2.1.0.0
7878
* [pySerial](https://pypi.python.org/pypi/pyserial), version 3.4
7979
* [Python interface to FTDI driver/chip](http://fluidmotion.dyndns.org/zenphoto/index.php?p=news&title=Python-interface-to-FTDI-driver-chip)
80+
* Java Access Bridge 32 bit, from Zulu Community OpenJDK build 13.0.1+10Zulu (13.28.11)
8081

8182
Additionally, the following build time dependencies are included in Git submodules:
8283

sconstruct

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ envArm64['projectResFile'] = resFile
198198

199199
#Fill sourceDir with anything provided for it by miscDeps
200200
env.recursiveCopy(sourceDir,Dir('miscdeps/source'))
201+
# Copy in some other dependencies.
202+
jabDll = "windowsaccessbridge-32.dll"
203+
Command(sourceLibDir.File(jabDll),
204+
env.Dir("#include/javaAccessBridge32").File(jabDll),
205+
Copy("$TARGET", "$SOURCE"))
201206

202207
env.SConscript('source/comInterfaces_sconscript',exports=['env'])
203208

source/JABHandler.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This file is covered by the GNU General Public License.
55
# See the file COPYING for more details.
66

7+
import os
78
import queue
89
from ctypes import (
910
c_short,
@@ -37,6 +38,7 @@
3738
import NVDAObjects.JAB
3839
import core
3940
import textUtils
41+
import NVDAHelper
4042

4143
#Some utility functions to help with function defines
4244

@@ -56,24 +58,15 @@ def _fixBridgeFunc(restype,name,*argtypes,**kwargs):
5658
if kwargs.get('errcheck'):
5759
func.errcheck=_errcheck
5860

59-
#Load the first available access bridge dll
60-
legacyAccessBridge=True
61-
try:
62-
bridgeDll=getattr(cdll,'windowsAccessBridge-32')
63-
legacyAccessBridge=False
64-
except WindowsError:
65-
try:
66-
bridgeDll=cdll.windowsAccessBridge
67-
except WindowsError:
68-
bridgeDll=None
61+
bridgeDll = None
6962

7063
#Definitions of access bridge types, structs and prototypes
7164

7265
jchar=c_wchar
7366
jint=c_int
7467
jfloat=c_float
7568
jboolean=c_bool
76-
class JOBJECT64(c_int if legacyAccessBridge else c_int64):
69+
class JOBJECT64(c_int64):
7770
pass
7871
AccessibleTable=JOBJECT64
7972

@@ -248,8 +241,9 @@ class AccessibleKeyBindings(Structure):
248241
AccessBridge_PropertyCaretChangeFP=CFUNCTYPE(None,c_long,JOBJECT64,JOBJECT64,c_int,c_int)
249242
AccessBridge_PropertyActiveDescendentChangeFP=CFUNCTYPE(None,c_long,JOBJECT64,JOBJECT64,JOBJECT64,JOBJECT64)
250243

251-
#Appropriately set the return and argument types of all the access bridge dll functions
252-
if bridgeDll:
244+
def _fixBridgeFuncs():
245+
"""Appropriately set the return and argument types of all the access bridge dll functions
246+
"""
253247
_fixBridgeFunc(None,'Windows_run')
254248
_fixBridgeFunc(None,'setFocusGainedFP',c_void_p)
255249
_fixBridgeFunc(None,'setPropertyNameChangeFP',c_void_p)
@@ -741,9 +735,13 @@ def isJavaWindow(hwnd):
741735
return bridgeDll.isJavaWindow(hwnd)
742736

743737
def initialize():
744-
global isRunning
745-
if not bridgeDll:
738+
global bridgeDll, isRunning
739+
try:
740+
bridgeDll = cdll.LoadLibrary(
741+
os.path.join(NVDAHelper.versionedLibPath, "windowsaccessbridge-32.dll"))
742+
except WindowsError:
746743
raise NotImplementedError("dll not available")
744+
_fixBridgeFuncs()
747745
bridgeDll.Windows_run()
748746
# Accept wm_copydata and any wm_user messages from other processes even if running with higher privileges
749747
if not windll.user32.ChangeWindowMessageFilter(winUser.WM_COPYDATA, 1):
@@ -775,9 +773,5 @@ def terminate():
775773
bridgeDll.setPropertyCaretChangeFP(None)
776774
h=bridgeDll._handle
777775
bridgeDll=None
778-
if legacyAccessBridge:
779-
del cdll.windowsAccessBridge
780-
else:
781-
delattr(cdll,'windowsAccessBridge-32')
782776
windll.kernel32.FreeLibrary(h)
783777
isRunning=False

0 commit comments

Comments
 (0)