[Nvda-dev] commit r3471 - trunk/source/NVDAHelper/client

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r3471 - trunk/source/NVDAHelper/client

NVDA Subversion
Author: bzr
Date: Thu Jan 21 05:18:04 2010
New Revision: 3471

Log:
Introducing  nvdaControllerClient.dll, which can be used from external applications, to communicate with NVDA.
This client dll exposes the nvdaController RPC interface, which currently has the following functions: getNVDAVersionString, speakText, cancelSpeech, and brailleMessage.
Due to recent changes to nvdaController, these client functions can be used with out worrying about RPC exceptions, and or binding handles. Any errors will be given back as the return code.
nvdaControllerClient.dll now gets built along with nvdaHelper (its code lives in nvdaHelper/client/), and the dll is placed in NVDA's lib and lib64 directories.


Added:
   trunk/source/NVDAHelper/client/
   trunk/source/NVDAHelper/client/client.c
   trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def
   trunk/source/NVDAHelper/client/sconscript

Added: trunk/source/NVDAHelper/client/client.c
==============================================================================
--- (empty file)
+++ trunk/source/NVDAHelper/client/client.c Thu Jan 21 05:18:04 2010
@@ -0,0 +1,19 @@
+#include <windows.h>
+#include <interfaces/nvdaController/nvdaController.h>
+
+void* __RPC_USER midl_user_allocate(size_t size) {
+ return malloc(size);
+}
+
+void __RPC_USER midl_user_free(void* p) {
+ free(p);
+}
+
+BOOL DllMain(HINSTANCE hModule,DWORD reason,LPVOID lpReserved) {
+ if(reason==DLL_PROCESS_ATTACH) {
+ RpcBindingFromStringBinding((RPC_WSTR)L"ncalrpc:[nvdaController]",&nvdaControllerBindingHandle);
+ } else if(reason==DLL_PROCESS_DETACH) {
+ RpcBindingFree(&nvdaControllerBindingHandle);
+ }
+ return TRUE;
+}

Added: trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def
==============================================================================
--- (empty file)
+++ trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def Thu Jan 21 05:18:04 2010
@@ -0,0 +1,7 @@
+;nvdaControllerClient.def
+LIBRARY              nvdaControllerClient.dll
+EXPORTS
+ nvdaController_getNVDAVersionString
+ nvdaController_speakText
+ nvdaController_cancelSpeech
+ nvdaController_brailleMessage

Added: trunk/source/NVDAHelper/client/sconscript
==============================================================================
--- (empty file)
+++ trunk/source/NVDAHelper/client/sconscript Thu Jan 21 05:18:04 2010
@@ -0,0 +1,18 @@
+Import([
+ 'env',
+ 'nvdaControllerRPCStubs',
+])
+
+clientLib=env.SharedLibrary(
+ target="nvdaControllerClient",
+ source=[
+ "client.c",
+ nvdaControllerRPCStubs[1],
+ ],
+ LIBS=[
+ "rpcrt4",
+ ],
+ LINKFLAGS="${LINKFLAGS} /def:${TARGET}.def",
+)
+
+Return('clientLib')


Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] commit r3471 - trunk/source/NVDAHelper/client

Hrvoje Katić
Oh, how cool! Just a question: Should I distribute
NVDAControllerClient.dll with my applications or will it be
automatically registered on a system where NVDA is installed?

On 21.1.2010. 6:18, NVDA Subversion wrote:

> Author: bzr
> Date: Thu Jan 21 05:18:04 2010
> New Revision: 3471
>
> Log:
> Introducing  nvdaControllerClient.dll, which can be used from external applications, to communicate with NVDA.
> This client dll exposes the nvdaController RPC interface, which currently has the following functions: getNVDAVersionString, speakText, cancelSpeech, and brailleMessage.
> Due to recent changes to nvdaController, these client functions can be used with out worrying about RPC exceptions, and or binding handles. Any errors will be given back as the return code.
> nvdaControllerClient.dll now gets built along with nvdaHelper (its code lives in nvdaHelper/client/), and the dll is placed in NVDA's lib and lib64 directories.
>
>
> Added:
>     trunk/source/NVDAHelper/client/
>     trunk/source/NVDAHelper/client/client.c
>     trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def
>     trunk/source/NVDAHelper/client/sconscript
>
> Added: trunk/source/NVDAHelper/client/client.c
> ==============================================================================
> --- (empty file)
> +++ trunk/source/NVDAHelper/client/client.c Thu Jan 21 05:18:04 2010
> @@ -0,0 +1,19 @@
> +#include<windows.h>
> +#include<interfaces/nvdaController/nvdaController.h>
> +
> +void* __RPC_USER midl_user_allocate(size_t size) {
> + return malloc(size);
> +}
> +
> +void __RPC_USER midl_user_free(void* p) {
> + free(p);
> +}
> +
> +BOOL DllMain(HINSTANCE hModule,DWORD reason,LPVOID lpReserved) {
> + if(reason==DLL_PROCESS_ATTACH) {
> + RpcBindingFromStringBinding((RPC_WSTR)L"ncalrpc:[nvdaController]",&nvdaControllerBindingHandle);
> + } else if(reason==DLL_PROCESS_DETACH) {
> + RpcBindingFree(&nvdaControllerBindingHandle);
> + }
> + return TRUE;
> +}
>
> Added: trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def
> ==============================================================================
> --- (empty file)
> +++ trunk/source/NVDAHelper/client/nvdaControllerClient.dll.def Thu Jan 21 05:18:04 2010
> @@ -0,0 +1,7 @@
> +;nvdaControllerClient.def
> +LIBRARY              nvdaControllerClient.dll
> +EXPORTS
> + nvdaController_getNVDAVersionString
> + nvdaController_speakText
> + nvdaController_cancelSpeech
> + nvdaController_brailleMessage
>
> Added: trunk/source/NVDAHelper/client/sconscript
> ==============================================================================
> --- (empty file)
> +++ trunk/source/NVDAHelper/client/sconscript Thu Jan 21 05:18:04 2010
> @@ -0,0 +1,18 @@
> +Import([
> + 'env',
> + 'nvdaControllerRPCStubs',
> +])
> +
> +clientLib=env.SharedLibrary(
> + target="nvdaControllerClient",
> + source=[
> + "client.c",
> + nvdaControllerRPCStubs[1],
> + ],
> + LIBS=[
> + "rpcrt4",
> + ],
> + LINKFLAGS="${LINKFLAGS} /def:${TARGET}.def",
> +)
> +
> +Return('clientLib')
>
> _______________________________________________
> Nvda-dev mailing list
> [hidden email]
> http://lists.nvaccess.org/listinfo/nvda-dev
>
>    



Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] commit r3471 - trunk/source/NVDAHelper/client

James Teh
On 21/01/2010 6:47 PM, Hrvoje Katić wrote:
> Oh, how cool! Just a question: Should I distribute
> NVDAControllerClient.dll with my applications or will it be
> automatically registered on a system where NVDA is installed?
First, the dll cannot be registered; it is not a COM interface.
You should probably distribute the dll with your app. Because NVDA is a
portable screen reader, you can't guarantee that it will be installed.

Jamie

--
James Teh
Vice President
NV Access Inc, ABN 61773362390
Email: [hidden email]
Web site: http://www.nvaccess.org/


Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] Using the NVDAControllerClient in a application

Mike Bledig
In reply to this post by Hrvoje Katić
Ok I want to try call the NVDAControllerClient.dll functions from within a
visual basic 6 application, so that the app will use NVDA to have things
spoken. . Anyone got a little example to show how one can do this?

Mike





Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] Using the NVDAControllerClient in a application

Bram Duvigneau
Please check the archives for my discussion about this a few days ago.
It seems not ready for primetime yet.

Bram
On 21-1-2010 14:00, Mike Bledig wrote:

> Ok I want to try call the NVDAControllerClient.dll functions from within a
> visual basic 6 application, so that the app will use NVDA to have things
> spoken. . Anyone got a little example to show how one can do this?
>
> Mike
>
>
>
>
> _______________________________________________
> Nvda-dev mailing list
> [hidden email]
> http://lists.nvaccess.org/listinfo/nvda-dev



Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] Using the NVDAControllerClient in a application

Mike Bledig
Hello

On 21 January 2010 03:04 PM Bram Duvigneau wrote:

Please check the archives for my discussion about this a few days ago.
It seems not ready for primetime yet.

So, are you saying, that this can't be implemented in applications yet?

Mike




Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] Using the NVDAControllerClient in a application

Lex-2
Hi.

21.01.2010 21:00, Mike Bledig пишет:
> So, are you saying, that this can't be implemented in applications yet?
>    
It is possible now, see changelog.


Reply | Threaded
Open this post in threaded view
|

Re: [Nvda-dev] Using the NVDAControllerClient in a application

Michael Curran-3
Hi,

In the next few days I'll write up some small examples and a little bit
of documentation on how it can now be used.

Thanks
Mick



On 22/01/2010 6:17 AM, Lex wrote:

> Hi.
>
> 21.01.2010 21:00, Mike Bledig пишет:
>> So, are you saying, that this can't be implemented in applications yet?
> It is possible now, see changelog.
>
> _______________________________________________
> Nvda-dev mailing list
> [hidden email]
> http://lists.nvaccess.org/listinfo/nvda-dev


--
Michael Curran
President, NV Access Inc
Email: [hidden email]
Website: www.nvaccess.org
ABN 61773362390.