OSDN Git Service

nvdaController interface and client: make all functions use the stdcall calling conve...
authorMichael Curran <mick@kulgan.net>
Mon, 25 Jan 2010 01:58:59 +0000 (12:58 +1100)
committerMichael Curran <mick@kulgan.net>
Mon, 25 Jan 2010 01:58:59 +0000 (12:58 +1100)
extras/controllerClient/example_python.py
source/NVDAHelper.py
source/NVDAHelper/interfaces/nvdaController/nvdaController.idl
source/NVDAHelper/local/nvdaController.c

index 223c958..73e6d45 100644 (file)
@@ -2,7 +2,7 @@ import time
 import ctypes\r
 \r
 #Load the NVDA client library\r
-clientLib=ctypes.cdll.LoadLibrary('./nvdaControllerClient32.dll')\r
+clientLib=ctypes.windll.LoadLibrary('./nvdaControllerClient32.dll')\r
 \r
 #Test if NVDA is running, and if its not show a message\r
 res=clientLib.nvdaController_testIfRunning()\r
index f96e346..0f507e3 100755 (executable)
@@ -29,27 +29,27 @@ def _setDllFuncPointer(dll,name,cfunc):
        cast(getattr(dll,name),POINTER(c_void_p)).contents.value=cast(cfunc,c_void_p).value\r
 \r
 #Implementation of nvdaController methods\r
-@CFUNCTYPE(c_long,POINTER(c_wchar_p))\r
+@WINFUNCTYPE(c_long,POINTER(c_wchar_p))\r
 def nvdaController_getNVDAVersionString(version):\r
        import versionInfo\r
        version.contents.value=versionInfo.version\r
        return 0\r
 \r
-@CFUNCTYPE(c_long,c_wchar_p)\r
+@WINFUNCTYPE(c_long,c_wchar_p)\r
 def nvdaController_speakText(text):\r
        import queueHandler\r
        import speech\r
        queueHandler.queueFunction(queueHandler.eventQueue,speech.speakText,text)\r
        return 0\r
 \r
-@CFUNCTYPE(c_long)\r
+@WINFUNCTYPE(c_long)\r
 def nvdaController_cancelSpeech():\r
        import queueHandler\r
        import speech\r
        queueHandler.queueFunction(queueHandler.eventQueue,speech.cancelSpeech)\r
        return 0\r
 \r
-@CFUNCTYPE(c_long,c_wchar_p)\r
+@WINFUNCTYPE(c_long,c_wchar_p)\r
 def nvdaController_brailleMessage(text):\r
        import queueHandler\r
        import braille\r
index e79ac41..199528e 100644 (file)
@@ -13,28 +13,28 @@ interface NvdaController {
  * Retreaves the version of NVDA.\r
  * @param version  a pointer to the version string, must be freed when finnished with\r
  */\r
-       error_status_t getNVDAVersionString([out,string] wchar_t** version);\r
+       error_status_t __stdcall getNVDAVersionString([out,string] wchar_t** version);\r
 \r
 /**\r
  * Instructs NVDA to speak the given text.\r
  * @param text the text to speak.\r
  */\r
-       error_status_t speakText([in,string] const wchar_t* text);\r
+       error_status_t __stdcall speakText([in,string] const wchar_t* text);\r
 \r
 /**\r
  * Instructs NVDA to silence current speech.\r
  */\r
-       error_status_t cancelSpeech();\r
+       error_status_t __stdcall cancelSpeech();\r
 \r
 /**\r
  * Shows a given message on the braille display.\r
  * @param message the message that will be temporarily shown on the display\r
  */\r
-       error_status_t brailleMessage([in,string] const wchar_t* message);\r
+       error_status_t __stdcall brailleMessage([in,string] const wchar_t* message);\r
 \r
 /**\r
  * Tests if NVDA is running or not.\r
  */\r
-       error_status_t testIfRunning();\r
+       error_status_t __stdcall testIfRunning();\r
 \r
 };\r
index 7033fcb..56030a5 100644 (file)
@@ -1,26 +1,26 @@
 #include <windows.h>\r
 #include <interfaces/nvdaController/nvdaController.h>\r
 \r
-__declspec(dllexport) error_status_t(*_nvdaController_getNVDAVersionString)(wchar_t**);\r
-error_status_t nvdaController_getNVDAVersionString(wchar_t** version) {\r
+__declspec(dllexport) error_status_t(__stdcall *_nvdaController_getNVDAVersionString)(wchar_t**);\r
+error_status_t __stdcall nvdaController_getNVDAVersionString(wchar_t** version) {\r
        return _nvdaController_getNVDAVersionString(version);\r
 }\r
 \r
-__declspec(dllexport) error_status_t(*_nvdaController_speakText)(const wchar_t*);\r
-error_status_t nvdaController_speakText(const wchar_t* text) {\r
+__declspec(dllexport) error_status_t(__stdcall *_nvdaController_speakText)(const wchar_t*);\r
+error_status_t __stdcall nvdaController_speakText(const wchar_t* text) {\r
        return _nvdaController_speakText(text);\r
 }\r
 \r
-__declspec(dllexport) error_status_t(*_nvdaController_cancelSpeech)();\r
-error_status_t nvdaController_cancelSpeech() {\r
+__declspec(dllexport) error_status_t(__stdcall *_nvdaController_cancelSpeech)();\r
+error_status_t __stdcall nvdaController_cancelSpeech() {\r
        return _nvdaController_cancelSpeech();\r
 }\r
 \r
-__declspec(dllexport) error_status_t(*_nvdaController_brailleMessage)(const wchar_t*);\r
-error_status_t nvdaController_brailleMessage(const wchar_t* text) {\r
+__declspec(dllexport) error_status_t(__stdcall *_nvdaController_brailleMessage)(const wchar_t*);\r
+error_status_t __stdcall nvdaController_brailleMessage(const wchar_t* text) {\r
        return _nvdaController_brailleMessage(text);\r
 }\r
 \r
-error_status_t nvdaController_testIfRunning() {\r
+error_status_t __stdcall nvdaController_testIfRunning() {\r
        return 0;\r
 }\r