Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelDCurran committed Aug 3, 2018
2 parents 4a75bfe + 2909b20 commit d58e1cd
Show file tree
Hide file tree
Showing 101 changed files with 6,901 additions and 4,341 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extras/controllerClient/x64
source/_buildVersion.py
user_docs/*/keyCommands.t2t
output
testOutput
source/brailleDisplayDrivers/handyTech
./developerGuide.html
user_docs/build.t2tConf
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
[submodule "include/ia2"]
path = include/ia2
url = https://github.com/LinuxA11y/IAccessible2.git
[submodule "include/wxPython"]
path = include/wxPython
url = https://github.com/nvaccess/wxPython-bin.git
56 changes: 54 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ environment:

init:
- ps: |
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
if ($env:APPVEYOR_REPO_TAG_NAME -and $env:APPVEYOR_REPO_TAG_NAME.StartsWith("release-")) {
# Strip "release-" prefix.
$version = $env:APPVEYOR_REPO_TAG_NAME.Substring(8)
Expand Down Expand Up @@ -91,8 +92,8 @@ build_script:
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs
- 'echo scons args: %sconsArgs%'
- py scons.py source %sconsArgs%
# We don't need launcher to run tests, so run the tests before launcher.
- py scons.py tests %sconsArgs%
# We don't need launcher to run checkPot, so run the checkPot before launcher.
- py scons.py checkPot %sconsArgs%
# The pot gets built by tests, but we don't actually need it as a build artifact.
- del output\*.pot
- 'echo scons output targets: %sconsOutTargets%'
Expand All @@ -113,6 +114,57 @@ build_script:
- 7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
- cd ..

before_test:
# Manually grab pyscreeze 0.1.13 as latest release is completely broken.
- py -m pip install pyscreeze==0.1.13
- py -m pip install robotframework robotremoteserver pyautogui nose
- mkdir testOutput
- mkdir testOutput\unit
- mkdir testOutput\system
- ps: |
$errorCode=0
$nvdaLauncherFile=".\output\nvda"
if(!$env:release) {
$nvdaLauncherFile+="_snapshot"
}
$nvdaLauncherFile+="_${env:version}.exe"
echo NVDALauncherFile: $NVDALauncherFile
$outputDir=$(resolve-path .\testOutput)
$installerLogFilePath="$outputDir\nvda_install.log"
$installerProcess=start-process -FilePath "$nvdaLauncherFile" -ArgumentList "--install-silent --debug-logging --log-file $installerLogFilePath" -passthru
try {
$installerProcess | wait-process -Timeout 180
$errorCode=$installerProcess.ExitCode
} catch {
echo NVDA installer process timed out
$errorCode=1
}
Push-AppveyorArtifact $installerLogFilePath
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
test_script:
- ps: |
$errorCode=0
$outDir = (Resolve-Path .\testOutput\unit\)
$unitTestsXml = "$outDir\unitTests.xml"
py -m nose --with-xunit --xunit-file="$unitTestsXml" ./tests/unit
if($LastExitCode -ne 0) { $errorCode=$LastExitCode }
Push-AppveyorArtifact $unitTestsXml
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $unitTestsXml)
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
- ps: |
$testOutput = (Resolve-Path .\testOutput\)
$systemTestOutput = (Resolve-Path "$testOutput\system")
$testSource = "./tests/system"
py -m robot --loglevel DEBUG -d $systemTestOutput -x systemTests.xml -v whichNVDA:installed -P "$testSource/libraries" "$testSource"
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"
if($LastExitCode -ne 0) { $errorCode=$LastExitCode }
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$systemTestOutput\systemTests.xml"))
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
artifacts:
- path: output\*
- path: output\*\*
Expand Down
2 changes: 1 addition & 1 deletion include/espeak
Submodule espeak updated 422 files
1 change: 1 addition & 0 deletions include/wxPython
Submodule wxPython added at 5d878c
2 changes: 1 addition & 1 deletion miscDeps
Submodule miscDeps updated 1040 files
2 changes: 1 addition & 1 deletion nvdaHelper/espeak/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#define INCLUDE_KLATT 1
#define HAVE_SONIC_H 1

#define PACKAGE_VERSION "1.49.1 dev"
#define PACKAGE_VERSION "1.49.3 dev"
6 changes: 1 addition & 5 deletions nvdaHelper/espeak/sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ espeakLib=env.SharedLibrary(
"setlengths.c",
"spect.c",
"speech.c",
"ssml.c",
"synthdata.c",
"synthesize.c",
"synth_mbrola.c", # provides symbols used by synthesize.obj, voices.obj, and wavegen.obj
Expand Down Expand Up @@ -156,11 +157,6 @@ env.Install(espeakRepo.Dir('dictsource'),env.Glob(os.path.join(espeakRepo.abspat
#Compile all dictionaries
missingDicts=['zhy', ] #'mt','tn','tt']
dictSourcePath=espeakRepo.Dir('dictsource').abspath
# Remove emoji files before compiling dictionaries as currently many of these simply crash eSpeak at runtime
emojiGlob = os.path.join(espeakRepo.abspath,'dictsource','*_emoji')
for f in glob(emojiGlob):
print("Removing emoji file: %s"%f)
os.remove(f)
for f in env.Glob(os.path.join(dictSourcePath,'*_rules')):
lang=f.name.split('_')[0]
if lang in missingDicts: continue
Expand Down
62 changes: 6 additions & 56 deletions nvdaHelper/remote/tsf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static sinkMap_t gTsfSinks;
static LockableObject gTsfSinksLock;
static PVOID gLastCompStr = NULL;

class TsfSink : public ITfThreadMgrEventSink, public ITfActiveLanguageProfileNotifySink, public ITfTextEditSink, public ITfUIElementSink, public ITfInputProcessorProfileActivationSink {
class TsfSink : public ITfThreadMgrEventSink, public ITfTextEditSink, public ITfUIElementSink, public ITfInputProcessorProfileActivationSink {
public:
TsfSink();
~TsfSink();
Expand All @@ -75,8 +75,8 @@ class TsfSink : public ITfThreadMgrEventSink, public ITfActiveLanguageProfileNot
// ITfTextEditSink methods
STDMETHODIMP OnEndEdit(ITfContext*, TfEditCookie, ITfEditRecord*);

STDMETHODIMP ITfActiveLanguageProfileNotifySink::OnActivated(REFCLSID, REFGUID, BOOL);
STDMETHODIMP ITfInputProcessorProfileActivationSink::OnActivated(DWORD dwProfileType, LANGID langId, REFCLSID rclsid, REFGUID catId, REFGUID guidProfile, HKL hkl, DWORD dwFlags);
// ITfInputProcessorProfileActivationSink methods
STDMETHODIMP OnActivated(DWORD dwProfileType, LANGID langId, REFCLSID rclsid, REFGUID catId, REFGUID guidProfile, HKL hkl, DWORD dwFlags);

// ITfUIElementSink methods
STDMETHODIMP BeginUIElement(DWORD, BOOL*);
Expand Down Expand Up @@ -174,12 +174,7 @@ bool TsfSink::Initialize() {
(ITfThreadMgrEventSink*)this, &mThreadMgrCookie);
}
if (hr == S_OK) {
///For profile activations use ITfInputProcessProfileActivationSink if its available, otherwise ITfActiveLanguageNotifySink (usually on XP).
hr = src->AdviseSink(IID_ITfInputProcessorProfileActivationSink,(ITfInputProcessorProfileActivationSink*)this, &mLangProfCookie);
if(hr!=S_OK||mLangProfCookie==TF_INVALID_COOKIE) {
LOG_DEBUGWARNING(L"Cannot register ITfInputProcessorProfileActivationSink, trying ITfActiveLanguageProfileNotifySink instead");
hr = src->AdviseSink(IID_ITfActiveLanguageProfileNotifySink,(ITfActiveLanguageProfileNotifySink*)this, &mLangProfCookie);
}
}
if (hr == S_OK) {
hr = mpThreadMgr->QueryInterface(IID_ITfUIElementMgr,(void**)&mpUIElementMgr);
Expand Down Expand Up @@ -287,8 +282,6 @@ STDMETHODIMP TsfSink::QueryInterface(REFIID riid, LPVOID* ppvObj) {
if (IsEqualIID(riid, IID_IUnknown) ||
IsEqualIID(riid, IID_ITfThreadMgrEventSink)) {
*ppvObj = (ITfThreadMgrEventSink*)this;
} else if (IsEqualIID(riid, IID_ITfActiveLanguageProfileNotifySink)) {
*ppvObj = (ITfActiveLanguageProfileNotifySink*)this;
} else if (IsEqualIID(riid, IID_ITfInputProcessorProfileActivationSink)) {
*ppvObj = (ITfInputProcessorProfileActivationSink*)this;
} else if (IsEqualIID(riid, IID_ITfTextEditSink)) {
Expand Down Expand Up @@ -528,57 +521,14 @@ STDMETHODIMP TsfSink::OnEndEdit(
return S_OK;
}

//ITfActiveLanguageProfileNotifySink::OnActivated
//To notify NVDA (in XP) of a TSF profile change
STDMETHODIMP TsfSink::OnActivated(REFCLSID rClsID, REFGUID rProfGUID, BOOL activated) {
const CLSID null_clsid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
if (!activated) {
curTSFClsID=null_clsid;
hasActiveProfile=false;
return S_OK;
}
//Re-enable IME conversion mode update reporting as input lang change window message disabled it while completing the switch
curTSFClsID=rClsID;
if (IsEqualCLSID(rClsID, null_clsid)) {
hasActiveProfile = false;
// When switching to non-TSF profile, resend last input language
wchar_t buf[KL_NAMELENGTH];
GetKeyboardLayoutName(buf);
nvdaControllerInternal_inputLangChangeNotify(GetCurrentThreadId(),
HandleToUlong(GetKeyboardLayout(0)), buf);
handleIMEConversionModeUpdate(GetFocus(),true);
return S_OK;
}
hasActiveProfile = true;
ITfInputProcessorProfiles* profiles = create_input_processor_profiles();
if (!profiles) return S_OK;
HRESULT hr = S_OK;
LANGID lang = 0;
if (hr == S_OK)
hr = profiles->GetCurrentLanguage(&lang);
if (hr == S_OK) {
BSTR desc = NULL;
profiles->GetLanguageProfileDescription(rClsID, lang, rProfGUID, &desc);
if (desc) {
nvdaControllerInternal_inputLangChangeNotify(GetCurrentThreadId(),HandleToUlong(GetKeyboardLayout(0)), desc);
SysFreeString(desc);
}
}
profiles->Release();
handleIMEConversionModeUpdate(GetFocus(),true);
return S_OK;
}

//ITfInputProcessorProfileActivationSink::OnActivated
//To notify NVDA (Win7 and above) of a TSF profile change
STDMETHODIMP TsfSink::OnActivated(DWORD dwProfileType, LANGID langId, REFCLSID rclsid, REFGUID catId, REFGUID guidProfile, HKL hkl, DWORD dwFlags) {
const CLSID null_clsid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
if(dwProfileType==TF_PROFILETYPE_KEYBOARDLAYOUT) {
//This is a normal keyboard layout so forget any last active TSF profile
//This is a normal keyboard layout, so forget any last active TSF profile
hasActiveProfile=false;
curTSFClsID=null_clsid;
if(dwFlags&TF_IPSINK_FLAG_ACTIVE) {
//As its activating, report the layout change to NVDA
//As it is activating, report the layout change to NVDA
wchar_t buf[KL_NAMELENGTH];
GetKeyboardLayoutName(buf);
nvdaControllerInternal_inputLangChangeNotify(GetCurrentThreadId(),HandleToUlong(GetKeyboardLayout(0)), buf);
Expand Down Expand Up @@ -684,7 +634,7 @@ void TSF_thread_detached() {
}

bool isTSFThread(bool checkActiveProfile) {
TsfSink* tsf=fetchCurrentTsfSink();
TsfSink* tsf=fetchCurrentTsfSink();
if(!tsf) return false;
return checkActiveProfile?tsf->hasActiveProfile:true;
}
43 changes: 18 additions & 25 deletions nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,26 @@ This license can be found at:
using namespace std;

CComPtr<IAccessible2> getLabelElement(IAccessible2_2* element) {
std::unique_ptr<IUnknown*,std::function<void(IUnknown**)>> labelElementArray;
{
IUnknown** ppUnk=nullptr;
long nTargets=0;
constexpr int numRelations=1;
HRESULT res=element->get_relationTargetsOfType(IA2_RELATION_LABELLED_BY,numRelations,&ppUnk,&nTargets);
labelElementArray = {ppUnk, [=](IUnknown** ppUnk){
if(ppUnk) {
for(auto i=0; i<nTargets;++i) {
if(ppUnk[i]) ppUnk[i]->Release();
}
CoTaskMemFree(ppUnk);
}
}};
if(res!=S_OK) {
LOG_DEBUGWARNING(L"relationTargetsOfType for IA2_RELATION_LABELLED_BY failed with result "<<res);
return nullptr;
}
if(nTargets==0) {
LOG_DEBUG(L"relationTargetsOfType for IA2_RELATION_LABELLED_BY found no targets");
return nullptr;
}
IUnknown** ppUnk=nullptr;
long nTargets=0;
constexpr int numRelations=2;
HRESULT res=element->get_relationTargetsOfType(IA2_RELATION_LABELLED_BY,numRelations,&ppUnk,&nTargets);
if(res!=S_OK) return nullptr;
// Grab all the returned IUnknowns and store them as smart pointers within a smart pointer array
// so that any further returns will correctly release all the objects.
auto ppUnk_smart=make_unique<CComPtr<IUnknown>[]>(nTargets);
for(int i=0;i<nTargets;++i) {
ppUnk_smart[i].Attach(ppUnk[i]);
}
// we can now free the memory that Gecko allocated to give us the IUnknowns
CoTaskMemFree(ppUnk);
if(nTargets==0) {
LOG_DEBUG(L"relationTargetsOfType for IA2_RELATION_LABELLED_BY found no targets");
return nullptr;
}
return CComQIPtr<IAccessible2>(labelElementArray.get()[0]);
return CComQIPtr<IAccessible2>(ppUnk_smart[0]);
}


#define NAVRELATION_LABELLED_BY 0x1003
#define NAVRELATION_NODE_CHILD_OF 0x1005
const wchar_t EMBEDDED_OBJ_CHAR = 0xFFFC;
Expand Down Expand Up @@ -569,7 +562,7 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(IAccessible2* pacc,
// A version of the isLabelVisible function that caches its result
auto isLabelVisibleCached=[&]() {
if(!isLabelVisibleVal_) {
*isLabelVisibleVal_=isLabelVisible(pacc);
isLabelVisibleVal_=isLabelVisible(pacc);
}
return *isLabelVisibleVal_;
};
Expand Down
25 changes: 20 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NVDA

NVDA is a free, open source screen reader for Microsoft Windows.
NVDA (NonVisual Desktop Access) is a free, open source screen reader for Microsoft Windows.
It is developed by NV Access in collaboration with a global community of contributors.
To learn more about NVDA or download a copy, visit the main [NV Access](http://www.nvaccess.org/) website.

Expand Down Expand Up @@ -35,7 +35,7 @@ The NVDA source depends on several other packages to run correctly.
### Installed Dependencies
The following dependencies need to be installed on your system:

* [Python](http://www.python.org/), version 2.7.13, 32 bit
* [Python](http://www.python.org/), version 2.7.15, 32 bit
* Microsoft Visual Studio 2017 Community, Version 15.3 or later:
* Download from https://www.visualstudio.com/downloads/
* When installing Visual Studio, you need to enable the following:
Expand All @@ -44,7 +44,8 @@ The following dependencies need to be installed on your system:
* Desktop development with C++
* Then in the Summary list, under Desktop for C++, Optional grouping, ensure the following is selected:
* VC++ 2017 v141 toolset (x86,x64)
* Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64
* Windows 10 SDK (10.0.17134.0) for Desktop C++ x86 and x64
* Visual C++ ATL for x86 and x64


### Git Submodules
Expand All @@ -56,9 +57,10 @@ If you aren't sure, run `git submodule update` after every git pull, merge or ch
For reference, the following dependencies are included in Git submodules:

* [comtypes](https://github.com/enthought/comtypes), version 1.1.4
* [wxPython](http://www.wxpython.org/), version 3.0.2.0
* [wxPython](http://www.wxpython.org/), version 4.0.3
* [Six](https://pypi.python.org/pypi/six), version 1.10.0, required by wxPython
* [Python Windows Extensions](http://sourceforge.net/projects/pywin32/ ), build 218
* [eSpeak NG](https://github.com/espeak-ng/espeak-ng), commit 37121600
* [eSpeak NG](https://github.com/espeak-ng/espeak-ng), commit 910f4c2
* [Sonic](https://github.com/waywardgeek/sonic), commit 4f8c1d11
* [IAccessible2](http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2), commit 21bbb176
* [ConfigObj](http://www.voidspace.org.uk/python/configobj.html), version 4.6.0
Expand Down Expand Up @@ -230,3 +232,16 @@ To run only the translatable string checks (which check that all translatable st
```
scons checkPot
```

You may also use scons to run the system tests, though this will still rely on having set up the dependencies (see `tests/system/readme.md`).

```
scons systemTests
```

To run only specific system tests, specify them using the `filter` variable on the command line.
This filter accepts wildcard characters.

```
scons systemTests filter="Read welcome dialog"
```
2 changes: 2 additions & 0 deletions sconstruct
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ vars.Add(ListVariable("nvdaHelperDebugFlags", "a list of debugging features you
vars.Add(EnumVariable('nvdaHelperLogLevel','The level of logging you wish to see, lower is more verbose','15',allowed_values=[str(x) for x in xrange(60)]))
if "tests" in COMMAND_LINE_TARGETS:
vars.Add("unitTests", "A list of unit tests to run", "")
if "systemTests" in COMMAND_LINE_TARGETS:
vars.Add("filter", "A filter for the name of the system test(s) to run. Wildcards accepted.", "")

#Base environment for this and sub sconscripts
env = Environment(variables=vars,HOST_ARCH='x86',tools=["textfile","gettextTool","t2t",keyCommandsDocTool,'doxygen','recursiveInstall'])
Expand Down
3 changes: 3 additions & 0 deletions source/IAccessibleHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def flushEvents(self):
IA2_ROLE_TEXT_FRAME:controlTypes.ROLE_TEXTFRAME,
IA2_ROLE_TOGGLE_BUTTON:controlTypes.ROLE_TOGGLEBUTTON,
IA2_ROLE_VIEW_PORT:controlTypes.ROLE_VIEWPORT,
IA2_ROLE_CONTENT_DELETION:controlTypes.ROLE_DELETED_CONTENT,
IA2_ROLE_CONTENT_INSERTION:controlTypes.ROLE_INSERTED_CONTENT,
IA2_ROLE_BLOCK_QUOTE:controlTypes.ROLE_BLOCKQUOTE,
#some common string roles
"frame":controlTypes.ROLE_FRAME,
"iframe":controlTypes.ROLE_INTERNALFRAME,
Expand Down

0 comments on commit d58e1cd

Please sign in to comment.