More strictly adhere to nvdaControllerClient and Tolk parameters.
This commit is contained in:
@@ -23,7 +23,8 @@ nonactivating, and excluded from ordinary window switching. Therefore applicatio
|
|||||||
`nvdaControllerClient32.dll`, `nvdaControllerClient64.dll`, and `Tolk.dll`; no DLL override is
|
`nvdaControllerClient32.dll`, `nvdaControllerClient64.dll`, and `Tolk.dll`; no DLL override is
|
||||||
required.
|
required.
|
||||||
|
|
||||||
Plain speech, braille, cancel, and process ID calls are implemented. Speaking-state queries return
|
Plain speech queues like NVDA Controller output; Tolk's interrupt flag uses the separate cancel call
|
||||||
|
before speaking. Braille, cancel, and process ID calls are also implemented. Speaking-state queries return
|
||||||
`ERROR_CALL_NOT_IMPLEMENTED`, because Cthulhu's current speech backend does not expose an accurate
|
`ERROR_CALL_NOT_IMPLEMENTED`, because Cthulhu's current speech backend does not expose an accurate
|
||||||
answer. SSML is validated by Cthulhu and currently fails with `ERROR_NOT_SUPPORTED`. This is
|
answer. SSML is validated by Cthulhu and currently fails with `ERROR_NOT_SUPPORTED`. This is
|
||||||
intentional: accepting SSML while dropping mark callbacks or reporting completion too early would
|
intentional: accepting SSML while dropping mark callbacks or reporting completion too early would
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import re
|
||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
class WineAccessControllerContractTests(unittest.TestCase):
|
||||||
|
def test_legacy_speak_text_queues_without_cancelling_current_speech(self):
|
||||||
|
sourcePath = Path(__file__).resolve().parents[1] / "wine-access" / "main.cpp"
|
||||||
|
source = sourcePath.read_text(encoding="utf-8")
|
||||||
|
match = re.search(
|
||||||
|
r'extern "C" error_status_t __stdcall speakText\(.*?\n\}',
|
||||||
|
source,
|
||||||
|
re.DOTALL,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertIsNotNone(match)
|
||||||
|
self.assertIn(
|
||||||
|
'g_variant_new("(sb)", utf8.c_str(), FALSE)',
|
||||||
|
match.group(0),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
@@ -440,7 +440,8 @@ extern "C" error_status_t __stdcall testIfRunning(void) {
|
|||||||
}
|
}
|
||||||
extern "C" error_status_t __stdcall speakText(const wchar_t *text) {
|
extern "C" error_status_t __stdcall speakText(const wchar_t *text) {
|
||||||
const std::string utf8 = to_utf8(text);
|
const std::string utf8 = to_utf8(text);
|
||||||
return call_boolean("SpeakText", g_variant_new("(sb)", utf8.c_str(), TRUE));
|
// Tolk calls cancelSpeech separately when its interrupt argument is true.
|
||||||
|
return call_boolean("SpeakText", g_variant_new("(sb)", utf8.c_str(), FALSE));
|
||||||
}
|
}
|
||||||
extern "C" error_status_t __stdcall cancelSpeech(void) {
|
extern "C" error_status_t __stdcall cancelSpeech(void) {
|
||||||
return call_boolean("CancelSpeech", nullptr);
|
return call_boolean("CancelSpeech", nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user