Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
*.pyo
*.html
*.zip
RC*
build/
56 changes: 56 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,62 @@ Finally, a few words on multi-threaded applications. Tolk is not thread-safe. Al

## Usage

### Generate the `.dll`

1. Install the dependencies:

1.1 CLI dependencies to build the C++ `.dll`

```bash
choco install jom pandoc
```

> **PS:** [jom](https://community.chocolatey.org/packages/jom#install) is a CLI alternative to `nmake.exe` that is installed with Visual Studio. This is great to avoid to add manually `nmake` to the environment PATH variable

1.2 Install Java JDK and configure `$JAVA_HOME` environment variable to point to their path


2. Install [Visual Studio](https://visualstudio.microsoft.com) and the Workload: **C++ Desktop development**

Visual Studio is required to use the CLI tools such as: `rc`, `cl`. The IDE is required to use the **Developer Powershell for VS as well**.

Besides that, the Windows 10 SDK is required to use some `.dll's` that the CLI tools mentioned above requires.

2.1 Also, make sure that you installed the Windows 10 SDK (`10.0.19041.0`)

> **Warning:** For now, the version `10.0.2+` doesn't works to compile and generate the dll

3. Put the path below into you PATH environment variable

This is required to use the `cl` C++ compiler and set some dependencies into the INCLUDE path: (e.g `windows.h`)

```bash
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\[latest-version]\bin\Hostx86\arm64
```
4. Open the **Developer Powershell for VS [version]** CLI as a administrator user

5. Go to the directory of this cloned repository, and run [jom](https://community.chocolatey.org/packages/jom#install) (or `nmake.exe`, from Visual Studio folder) CLI to compiles the `.dll`

```powershell
cd tolk
jom /f .\Makefile
```

**Output**

```powershell
jom x.x.x - empower your cores

cd tolk\src && C:\ProgramData\chocolatey\lib\jom\tools\jom.exe /
cd tolk\src\dotnet && C:\ProgramData\chocolatey\lib\jom\tools\jom.exe /
cd tolk\src\java && C:\ProgramData\chocolatey\lib\jom\tools\jom.exe /
cd tolk\docs && C:\ProgramData\chocolatey\lib\jom\tools\jom.exe /
pandoc -s --toc -M title="Tolk" -M author="Davy Kager" -r markdown -w html5 -o .\README.html README.md
```
6. Use the generated `src/Tolk.dll` lib together with any language wrapper that you wish (dotnet, java...)

This command above will run the all `Makefile` on this project. You should see the generated C++ dll into `src/Tolk.dll` and the language wrappers as well: `src/dotnet/TolkDotNet.dll`, `src/java/Tolk.jar`...

Tolk has functions for (un)initialization, querying and using the active screen reader, and for working with Microsoft SAPI. To use Tolk, import the appropriate version of `Tolk.dll` into your application. In C/C++ this is usually done by including `Tolk.h` and linking with the appropriate import library `Tolk.lib`. You could also use the Windows API functions `LoadLibrary` and `FreeLibrary`. Other languages are also supported, see `Wrappers`. If you're working in an unsupported language, use its specific facilities to call into the DLL.

### Required files
Expand Down
4 changes: 3 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
OUTDIR = $(MAKEDIR)
!endif

# Referece "/I" flag:
# https://docs.microsoft.com/en-us/cpp/build/reference/i-additional-include-directories?view=msvc-170
CFLAGS = /nologo /O2 /EHsc /LD /Gw /W4 /WL \
/D_EXPORTING /DUNICODE /D_WITH_JNI
/D_EXPORTING /DUNICODE /D_WITH_JNI /I "$(JAVA_HOME)include" /I"$(JAVA_HOME)include\win32"
RFLAGS = /nologo

SYSLIBS = User32.Lib Ole32.Lib OleAut32.Lib
Expand Down
2 changes: 1 addition & 1 deletion src/ScreenReaderDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ScreenReaderDriver {
hasSpeech(speech),
hasBraille(braille)
{}
ScreenReaderDriver& operator=(const ScreenReaderDriver&) {}
ScreenReaderDriver& operator=(const ScreenReaderDriver&);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this cause a linker error?

I think what you want to do is this:
ScreenReaderDriver& operator=(const ScreenReaderDriver&) = delete;
to prevent copying.


public:
virtual ~ScreenReaderDriver() {}
Expand Down
1 change: 1 addition & 0 deletions src/ScreenReaderDriverSAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef _SCREEN_READER_DRIVER_SAPI_H_
#define _SCREEN_READER_DRIVER_SAPI_H_

#include <windows.h>
#include <sapi.h>
#include "ScreenReaderDriver.h"

Expand Down
2 changes: 1 addition & 1 deletion src/fsapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef IID CLSID;
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

#endif !_MIDL_USE_GUIDDEF_
#endif // !_MIDL_USE_GUIDDEF_

MIDL_DEFINE_GUID(IID, LIBID_FSAPILib,0xF152C4EF,0xB92F,0x4139,0xA9,0x01,0xE8,0xF1,0xE2,0x8C,0xC8,0xE0);

Expand Down
2 changes: 1 addition & 1 deletion src/wineyes.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef IID CLSID;
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

#endif !_MIDL_USE_GUIDDEF_
#endif // !_MIDL_USE_GUIDDEF_

MIDL_DEFINE_GUID(IID, LIBID_WindowEyes,0x9AA48166,0x4D1C,0x4C57,0xB5,0x43,0x4B,0x59,0x6C,0x5E,0x1C,0x2F);

Expand Down
2 changes: 1 addition & 1 deletion src/zt.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef IID CLSID;
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

#endif !_MIDL_USE_GUIDDEF_
#endif // !_MIDL_USE_GUIDDEF_

MIDL_DEFINE_GUID(IID, LIBID_AiSquared,0x9FBBC98E,0xAE78,0x4A1C,0xB6,0x35,0x1E,0xCA,0x2F,0xBF,0xFB,0x40);

Expand Down