Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b5e1286
Experimentially add a system test for APG checkbox (PR #11827)
zcorpan Nov 20, 2020
949416f
Improve presentation of graphical view table in disk management (PR #…
lukaszgo1 Nov 20, 2020
53cecfd
Revert live region changes to mshtml virtual buffer (PR #11838)
LeonarddeR Nov 20, 2020
043ca83
Fix NVDA may freeze when copying large amount of text (#11843) (#11852)
JulienCochuyt Nov 22, 2020
15ab401
Once again report when copying text in browse mode in MS Word. (#11848)
lukaszgo1 Nov 22, 2020
001c99b
Disable labels with the controls they are associated with (PR #11812)
CyrilleB79 Nov 25, 2020
82c6835
Prevent infinite recursion for unspeakable chars (PR #11865)
feerrenrut Nov 26, 2020
4704df6
handle aria-invalid="spelling,grammar" (#11787)
michaelDCurran Nov 26, 2020
5f06d76
Update and use official CLDR repository (PR #11817)
OzancanKaratas Nov 26, 2020
c2ae253
Fix crash opening BrailleViewer (PR #11873)
feerrenrut Nov 27, 2020
f0e82c7
Fix script for Word interfering with Outlook (PR #11824)
CyrilleB79 Nov 27, 2020
ba21333
Suppress duplicate Visual Studio tooltips (PR #11841)
LeonarddeR Nov 27, 2020
be581e8
Move _nvdaControllerInternal_reportLiveRegion to the end of interface…
lukaszgo1 Nov 30, 2020
559ce07
Windows 10 Calculator: resolve expression entry repetitions (PR #9429)
josephsl Nov 30, 2020
874230a
Re-introduce new live region announcement implementation for mshtml (…
LeonarddeR Nov 30, 2020
47bc91e
Change “Focus Highlight” to “Visual Highlight” (PR #11878)
OzancanKaratas Dec 1, 2020
7b72c21
Win10 Calc: results announcement in compact overlay and unit converte…
josephsl Dec 1, 2020
f0391fb
No longer override isAlive on UIA WordBrowseModeDocument (#11885)
LeonarddeR Dec 1, 2020
f99644e
Fix frequent error sounds with Cancellable speech (PR #11887)
feerrenrut Dec 4, 2020
f95f890
Merge remote-tracking branch 'origin/master' into branchForRelease2020.4
feerrenrut Dec 7, 2020
c6932ba
Fix case error for NVDA acronym in changes file
feerrenrut Dec 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
[submodule "include/configobj"]
path = include/configobj
url = https://github.com/DiffSK/configobj.git
[submodule "include/cldr-emoji-annotation"]
path = include/cldr-emoji-annotation
url = https://github.com/fujiwarat/cldr-emoji-annotation
[submodule "include/py2exe"]
path = include/py2exe
url = https://github.com/nvaccess/py2exe-bin
Expand All @@ -46,3 +43,6 @@
[submodule "include/w3c-aria-practices"]
path = include/w3c-aria-practices
url = https://github.com/w3c/aria-practices
[submodule "include/cldr"]
path = include/cldr
url = https://github.com/unicode-org/cldr.git
4 changes: 2 additions & 2 deletions cldrDict_sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ NVDAToCLDRLocales = {
"zh_tw":("zh","zh_Hant"),
}

annotationsDir = env.Dir("include/cldr-emoji-annotation/annotations")
annotationsDerivedDir = env.Dir("include/cldr-emoji-annotation/annotationsDerived")
annotationsDir = env.Dir("include/cldr/common/annotations")
annotationsDerivedDir = env.Dir("include/cldr/common/annotationsDerived")
for destLocale, sourceLocales in NVDAToCLDRLocales.items():
cldrSources = []
# First add all annotations, then the derived ones.
Expand Down
1 change: 1 addition & 0 deletions include/cldr
Submodule cldr added at d1c59a
1 change: 0 additions & 1 deletion include/cldr-emoji-annotation
Submodule cldr-emoji-annotation deleted from abab17
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
]
interface NvdaControllerInternal {
[fault_status,comm_status] requestRegistration();
[fault_status,comm_status] reportLiveRegion();
[fault_status,comm_status] inputLangChangeNotify();
[fault_status,comm_status] typedCharacterNotify();
[fault_status,comm_status] displayModelTextChangeNotify();
[fault_status,comm_status] logMessage();
[fault_status,comm_status] vbufChangeNotify();
[fault_status,comm_status] installAddonPackageFromPath();
[fault_status,comm_status] drawFocusRectNotify();
[fault_status,comm_status] reportLiveRegion();
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ interface NvdaControllerInternal {

error_status_t __stdcall requestRegistration([in,string] const wchar_t* uuidString);

/**
* Notifies NVDA that a live region was updated.
* @param text the text to report for the live region.
* @param level The level of live region, I.E. "polite"
*/
error_status_t __stdcall reportLiveRegion([in,string] const wchar_t* text, [in,string] const wchar_t* level);

/**
* Notifies NVDA that the keyboard layout has changed for this thread.
* @param threadID the thread the layout change occured in
Expand Down Expand Up @@ -97,4 +90,11 @@ interface NvdaControllerInternal {
* Notifies NVDA that a focus rect has been drawn in the given window.
*/
error_status_t __stdcall drawFocusRectNotify([in] const long hwnd, [in] const long left, [in] const long top, [in] const long right, [in] const long bottom);

/**
* Notifies NVDA that a live region was updated.
* @param text the text to report for the live region.
* @param level The level of live region, I.E. "polite"
*/
error_status_t __stdcall reportLiveRegion([in,string] const wchar_t* text, [in,string] const wchar_t* level);
};
10 changes: 5 additions & 5 deletions nvdaHelper/local/nvdaControllerInternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ error_status_t __stdcall nvdaControllerInternal_requestRegistration(const wchar_
return _nvdaControllerInternal_requestRegistration(uuidString);
}

error_status_t(__stdcall *_nvdaControllerInternal_reportLiveRegion)(const wchar_t*, const wchar_t*);
error_status_t __stdcall nvdaControllerInternal_reportLiveRegion(const wchar_t* text, const wchar_t* politeness) {
return _nvdaControllerInternal_reportLiveRegion(text, politeness);
}

error_status_t(__stdcall *_nvdaControllerInternal_inputLangChangeNotify)(const long, const unsigned long, const wchar_t*);
error_status_t __stdcall nvdaControllerInternal_inputLangChangeNotify(const long threadID, const unsigned long hkl, const wchar_t* layoutString) {
return _nvdaControllerInternal_inputLangChangeNotify(threadID,hkl,layoutString);
Expand Down Expand Up @@ -79,3 +74,8 @@ error_status_t(__stdcall *_nvdaControllerInternal_drawFocusRectNotify)(const lon
error_status_t __stdcall nvdaControllerInternal_drawFocusRectNotify(const long hwnd, const long left, const long top, const long right, const long bottom) {
return _nvdaControllerInternal_drawFocusRectNotify(hwnd,left,top,right,bottom);
}

error_status_t(__stdcall *_nvdaControllerInternal_reportLiveRegion)(const wchar_t*, const wchar_t*);
error_status_t __stdcall nvdaControllerInternal_reportLiveRegion(const wchar_t* text, const wchar_t* politeness) {
return _nvdaControllerInternal_reportLiveRegion(text, politeness);
}
2 changes: 1 addition & 1 deletion nvdaHelper/local/nvdaHelperLocal.def
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ EXPORTS
VBuf_locateTextFieldNodeAtOffset
VBuf_setSelectionOffsets
_nvdaControllerInternal_requestRegistration
_nvdaControllerInternal_reportLiveRegion
_nvdaControllerInternal_displayModelTextChangeNotify
_nvdaControllerInternal_inputLangChangeNotify
_nvdaControllerInternal_inputCompositionUpdate
Expand Down Expand Up @@ -61,3 +60,4 @@ EXPORTS
audioDucking_shouldDelay
logMessage
getOleClipboardText
_nvdaControllerInternal_reportLiveRegion
2 changes: 1 addition & 1 deletion nvdaHelper/remote/nvdaHelperRemote.def
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ EXPORTS
logMessage
NVDALogCrtReportHook
nvdaInProcUtils_winword_expandToLine
nvdaControllerInternal_reportLiveRegion
nvdaControllerInternal_logMessage
nvdaControllerInternal_vbufChangeNotify
nvdaControllerInternal_installAddonPackageFromPath
nvdaController_testIfRunning
nvdaController_speakText
nvdaController_cancelSpeech
nvdaController_brailleMessage
nvdaControllerInternal_reportLiveRegion
9 changes: 3 additions & 6 deletions nvdaHelper/vbufBackends/mshtml/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void MshtmlVBufStorage_controlFieldNode_t::preProcessLiveRegion(const MshtmlVBuf
if (this->ariaLiveNode) {
this->ariaLivePoliteness = this->ariaLiveNode->ariaLivePoliteness;
} else {
this->ariaLivePoliteness = nullptr;
this->ariaLivePoliteness = L"";
}
}
i=attribsMap.find(L"HTMLAttrib::aria-relevant");
Expand Down Expand Up @@ -411,11 +411,8 @@ void MshtmlVBufStorage_controlFieldNode_t::preProcessLiveRegion(const MshtmlVBuf
}

void MshtmlVBufStorage_controlFieldNode_t::reportLiveText(wstring& text, wstring& politeness) {
for(auto c: text) {
if(!iswspace(c)) {
nvdaControllerInternal_reportLiveRegion(text.c_str(), politeness.c_str());
break;
}
if(!all_of(text.cbegin(), text.cend(), iswspace)) {
nvdaControllerInternal_reportLiveRegion(text.c_str(), politeness.c_str());
}
}

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ For reference, the following run time dependencies are included in Git submodule
* [ConfigObj](https://github.com/DiffSK/configobj), commit f9a265c
* [Six](https://pypi.python.org/pypi/six), version 1.12.0, required by wxPython and ConfigObj
* [liblouis](http://www.liblouis.org/), version 3.15.0
* [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) Emoji Annotations, version 37.0
* [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) Emoji Annotations, version 38.0
* NVDA images and sounds
* [Adobe Acrobat accessibility interface, version XI](https://download.macromedia.com/pub/developer/acrobat/AcrobatAccess.zip)
* Adobe FlashAccessibility interface typelib
Expand Down
7 changes: 4 additions & 3 deletions source/NVDAObjects/IAccessible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ def normalizeIA2TextFormatField(formatField):
except KeyError:
invalid=None
if invalid:
invalid=invalid.lower()
if invalid=="spelling":
# aria-invalid can contain multiple values separated by a comma.
invalidList = [x.lower().strip() for x in invalid.split(',')]
if "spelling" in invalidList:
formatField["invalid-spelling"]=True
elif invalid=="grammar":
if "grammar" in invalidList:
formatField["invalid-grammar"]=True
color=formatField.get('color')
if color:
Expand Down
33 changes: 32 additions & 1 deletion source/NVDAObjects/UIA/VisualStudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
available in Visual Studio and SQL Server Management Studio.
"""

from . import UIA
from . import UIA, ToolTip
import speech
import braille
import api
import time


class IntelliSenseItem(UIA):
Expand Down Expand Up @@ -53,6 +54,34 @@ class IntelliSenseLiveRegion(UIA):
}


class CompletionToolTip(ToolTip):
""" A tool tip for which duplicate open events can be fired.
"""

#: Keeps track of the last ToolTipOpened event (text, time)
_lastToolTipOpenedInfo = (None, None)
#: The duplicate tooltip events will be dropped within this time window
_preventDuplicateToolTipSeconds = 0.2

def event_UIA_toolTipOpened(self):
oldText, oldTime = self._lastToolTipOpenedInfo
newText = self.name
newTime = time.time()
self.__class__._lastToolTipOpenedInfo = (newText, newTime)
withinPossibleDupToolTipTimeWindow = (
oldTime is not None
and (newTime - oldTime) < self._preventDuplicateToolTipSeconds
)
if newText == oldText and withinPossibleDupToolTipTimeWindow:
# Tool-tip event suspected to be a duplicate, drop the event.
# - Users attempting to rapidly re-announce tool-tips may
# have the announcement erroneously suppressed
# - Users on slower systems (or systems under load) may still
# receive duplicate announcements
return
super().event_UIA_toolTipOpened()


def findExtraOverlayClasses(obj, clsList):
if obj.UIAAutomationId in _INTELLISENSE_LIST_AUTOMATION_IDS:
clsList.insert(0, IntelliSenseList)
Expand All @@ -64,3 +93,5 @@ def findExtraOverlayClasses(obj, clsList):
and isinstance(obj.previous.previous, IntelliSenseList)
):
clsList.insert(0, IntelliSenseLiveRegion)
elif obj.UIAAutomationId == "completion tooltip":
clsList.insert(0, CompletionToolTip)
3 changes: 0 additions & 3 deletions source/NVDAObjects/UIA/wordDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ def getTextWithFields(self,formatConfig=None):

class WordBrowseModeDocument(UIABrowseModeDocument):

def _get_isAlive(self):
return True

def shouldSetFocusToObj(self,obj):
# Ignore strange editable text fields surrounding most inner fields (links, table cells etc)
if obj.role==controlTypes.ROLE_EDITABLETEXT and obj.UIAElement.cachedAutomationID.startswith('UIA_AutomationId_Word_Content'):
Expand Down
25 changes: 3 additions & 22 deletions source/NVDAObjects/window/winword.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: UTF-8 -*-
# NVDAObjects/window/winword.py
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2020 NV Access Limited, Manish Agrawal, Derek Riemer, Babbage B.V.
# This file is covered by the GNU General Public License.
Expand Down Expand Up @@ -613,8 +611,10 @@ def _get_locationText(self):
textList.append(_("{distance} from top edge of page").format(distance=distance))
return ", ".join(textList)

def copyToClipboard(self):
def copyToClipboard(self, notify):
self._rangeObj.copy()
if notify:
ui.reportTextCopiedToClipboard(self.text)
return True

def find(self,text,caseSensitive=False,reverse=False):
Expand Down Expand Up @@ -1372,24 +1372,6 @@ def script_increaseDecreaseFontSize(self,gesture):
# Translators: a message when increasing or decreasing font size in Microsoft Word
ui.message(_("{size:g} point font").format(size=val))

def script_toggleChangeTracking(self, gesture):
if not self.WinwordDocumentObject:
# We cannot fetch the Word object model, so we therefore cannot report the status change.
# The object model may be unavailable because this is a pure UIA implementation such as Windows 10 Mail,
# or it's within Windows Defender Application Guard.
# In this case, just let the gesture through and don't report anything.
return gesture.send()
val = self._WaitForValueChangeForAction(
lambda: gesture.send(),
lambda: self.WinwordDocumentObject.TrackRevisions
)
if val:
# Translators: a message when toggling change tracking in Microsoft word
ui.message(_("Change tracking on"))
else:
# Translators: a message when toggling change tracking in Microsoft word
ui.message(_("Change tracking off"))

@script(gesture="kb:control+shift+8")
def script_toggleDisplayNonprintingCharacters(self, gesture):
if not self.WinwordWindowObject:
Expand Down Expand Up @@ -1514,7 +1496,6 @@ def initOverlayClass(self):
"kb:control+1":"changeLineSpacing",
"kb:control+2":"changeLineSpacing",
"kb:control+5":"changeLineSpacing",
"kb:control+shift+e": "toggleChangeTracking",
"kb:control+pageUp": "caret_moveByLine",
"kb:control+pageDown": "caret_moveByLine",
}
Expand Down
2 changes: 1 addition & 1 deletion source/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def setFocusObject(obj):
try:
treeInterceptorObject=treeInterceptorHandler.update(o)
except:
log.exception("Error updating tree interceptor")
log.error("Error updating tree interceptor", exc_info=True)
#Always make sure that the focus object's treeInterceptor is forced to either the found treeInterceptor (if its in it) or to None
#This is to make sure that the treeInterceptor does not have to be looked up, which can cause problems for winInputHook
if obj is o or obj in treeInterceptorObject:
Expand Down
108 changes: 108 additions & 0 deletions source/appModules/calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited, Joseph Lee
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

"""App module for Windows 10 Calculator"""

import appModuleHandler
import api
from NVDAObjects.UIA import UIA
import queueHandler
import ui
import scriptHandler

# #9428: do not announce current values until calculations are done in order to avoid repetitions.
noCalculatorEntryAnnouncements = [
# Display field with Calculator set to full screen mode.
"CalculatorResults",
# In the middle of a calculation expression entry.
"CalculatorExpression",
# Results display with Calculator set to compact overlay i.e. always on top mode.
"CalculatorAlwaysOnTopResults",
# Calculator expressions with Calculator set to always on top mode.
"ExpressionContainer",
# Date range selector.
"ContentPresenter",
# Briefly shown when closing date calculation calendar.
"Light Dismiss",
# Unit conversion/convert from.
"Value1",
# Unit conversion/converts into.
"Value2",
]


class AppModule(appModuleHandler.AppModule):

_shouldAnnounceResult = False
# Name change says the same thing multiple times for some items.
_resultsCache = ""

def event_nameChange(self, obj, nextHandler):
if not isinstance(obj, UIA):
return
# No, announce value changes immediately except for calculator results and expressions.
if (
obj.UIAAutomationId in noCalculatorEntryAnnouncements
or obj.UIAElement.cachedClassName == "LandmarkTarget"
):
self._shouldAnnounceResult = False
# For the rest:
elif (
obj.UIAAutomationId not in noCalculatorEntryAnnouncements
and obj.name != self._resultsCache
):
# For unit conversion, both name change and notification events are fired,
# although UIA notification event presents much better messages.
# For date calculation, live region change event is also fired for difference between dates.
if obj.UIAAutomationId != "DateDiffAllUnitsResultLabel":
ui.message(obj.name)
self._resultsCache = obj.name
if not self._shouldAnnounceResult:
return
self._shouldAnnounceResult = False
nextHandler()

def event_UIA_notification(self, obj, nextHandler, activityId=None, **kwargs):
try:
shouldAnnounceNotification = (
obj.previous.UIAAutomationId in
("numberPad", "UnitConverterRootGrid")
)
except AttributeError:
resultElement = api.getForegroundObject().children[1].lastChild
# Redesigned in 2019 due to introduction of "always on top" i.e. compact overlay mode.
if resultElement.UIAElement.cachedClassName != "LandmarkTarget":
resultElement = resultElement.parent.children[1]
shouldAnnounceNotification = (
resultElement
and resultElement.firstChild
and resultElement.firstChild.UIAAutomationId not in noCalculatorEntryAnnouncements
)
# Display updated activity ID seen when entering calculations should be ignored
# as as it is redundant if speak typed characters is on.
if shouldAnnounceNotification or activityId != "DisplayUpdated":
nextHandler()

# A list of native commands to handle calculator result announcement.
_calculatorResultGestures = ("kb:enter", "kb:numpadEnter", "kb:escape")

@scriptHandler.script(gestures=_calculatorResultGestures)
def script_calculatorResult(self, gesture):
# To prevent double focus announcement, check where we are.
focus = api.getFocusObject()
gesture.send()
# In redstone, calculator result keeps firing name change,
# so tell it to do so if and only if enter has been pressed.
self._shouldAnnounceResult = True
# Hack: only announce display text when an actual calculator button (usually equals button) is pressed.
# In redstone, pressing enter does not move focus to equals button.
if isinstance(focus, UIA):
if focus.UIAAutomationId in ("CalculatorResults", "CalculatorAlwaysOnTopResults"):
queueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)
else:
resultsScreen = api.getForegroundObject().children[1].lastChild
if isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == "LandmarkTarget":
# And no, do not allow focus to move.
queueHandler.queueFunction(queueHandler.eventQueue, resultsScreen.firstChild.reportFocus)
Loading