-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tolk.au3
101 lines (87 loc) · 2.25 KB
/
Tolk.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;;;
; Product: Tolk
; File: Tolk.au3
; Description: AutoIt wrapper file.
; Copyright: (c) 2014, Davy Kager <[email protected]>
; License: LGPLv3
;;
; Preload to avoid excessive loading/unloading
; AutoIt will take care of closing this on termination
Local Const $tolk = DllOpen("Tolk.dll")
Func Tolk_Load()
If $tolk <> -1 Then
DllCall($tolk, "NONE:cdecl", "Tolk_Load")
EndIf
EndFunc
Func Tolk_IsLoaded()
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_IsLoaded")[0]
EndIf
Return False
EndFunc
Func Tolk_Unload()
If $tolk <> -1 Then
DllCall($tolk, "NONE:cdecl", "Tolk_Unload")
EndIf
EndFunc
Func Tolk_TrySAPI($trySAPI)
If $tolk <> -1 Then
DllCall($tolk, "NONE:cdecl", "Tolk_TrySAPI", "BOOLEAN", $trySAPI)
EndIf
EndFunc
Func Tolk_PreferSAPI($preferSAPI)
If $tolk <> -1 Then
DllCall($tolk, "NONE:cdecl", "Tolk_PreferSAPI", "BOOLEAN", $preferSAPI)
EndIf
EndFunc
Func Tolk_DetectScreenReader()
If $tolk <> -1 Then
Local $name = DllCall($tolk, "WSTR:cdecl", "Tolk_DetectScreenReader")[0]
If $name <> "" Then
Return $name
EndIf
EndIf
Return Null
EndFunc
Func Tolk_HasSpeech()
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_HasSpeech")[0]
EndIf
Return False
EndFunc
Func Tolk_HasBraille()
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_HasBraille")[0]
EndIf
Return False
EndFunc
Func Tolk_Output(ByRef $str, $interrupt = False)
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_Output", "WSTR", $str, "BOOLEAN", $interrupt)[0]
EndIf
Return False
EndFunc
Func Tolk_Speak(ByRef $str, $interrupt = False)
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_Speak", "WSTR", $str, "BOOLEAN", $interrupt)[0]
EndIf
Return False
EndFunc
Func Tolk_Braille(ByRef $str)
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_Braille", "WSTR", $str)[0]
EndIf
Return False
EndFunc
Func Tolk_IsSpeaking()
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_IsSpeaking")[0]
EndIf
Return False
EndFunc
Func Tolk_Silence()
If $tolk <> -1 Then
Return DllCall($tolk, "BOOLEAN:cdecl", "Tolk_Silence")[0]
EndIf
Return False
EndFunc