Mercurial > hg > orthanc-stone
comparison Platforms/Wasm/wasm-application-runner.ts @ 508:7105a0bad250 bgo-commands-codegen
- Added HandleSerializedMessage to IStoneApplication (empty impl)
- Split UpdateWebApplication with "WithString" and "WithSerializedMessage" variants
- Due to the modules in TS, globals are now unallowed and the callbacks from C++ to JS are stored in the "window" instance
- Split UpdateStoneApplicationStatusFromCpp with "WithString" and "WithSerializedMessage" variants
- Split NotifyStatusUpdateFromCppToWeb with "WithString" and "WithSerializedMessage" variants
- SendMessageToStoneApplication (C++ global) has been split into SendSerializedMessageToStoneApplication and SendCommandToStoneApplication
- In WasmPlatformApplicationAdapter: HandleMessageFromWeb becomes HandleCommandFromWeb
- In WasmPlatformApplicationAdapter: added HandleSerializedMessageFromWeb
- stonegentool now handles the "json" primitive type (used, a.o., in the VSOL "EditInstance" message)
- Fixed indentation and added json serialization overloads in the stonegentool templates
- Added test of the json primitive type to testWasmIntegrated (in Resources/CodeGeneration)
- Adapted testWasmIntegrated (in Resources/CodeGeneration) to the changes above
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 06 Mar 2019 10:14:59 +0100 |
parents | 5055031f4a06 |
children | 548eed46f535 |
comparison
equal
deleted
inserted
replaced
507:ce49eae4c887 | 508:7105a0bad250 |
---|---|
17 var SetStartupParameter: Function = null; | 17 var SetStartupParameter: Function = null; |
18 var CreateWasmApplication: Function = null; | 18 var CreateWasmApplication: Function = null; |
19 export var CreateCppViewport: Function = null; | 19 export var CreateCppViewport: Function = null; |
20 var ReleaseCppViewport: Function = null; | 20 var ReleaseCppViewport: Function = null; |
21 var StartWasmApplication: Function = null; | 21 var StartWasmApplication: Function = null; |
22 export var SendMessageToStoneApplication: Function = null; | 22 export var SendSerializedMessageToStoneApplication: Function = null; |
23 export var SendCommandToStoneApplication: Function = null; | |
23 | 24 |
24 function DoAnimationThread() { | 25 function DoAnimationThread() { |
25 if (WasmDoAnimation != null) { | 26 if (WasmDoAnimation != null) { |
26 WasmDoAnimation(); | 27 WasmDoAnimation(); |
27 } | 28 } |
97 (<any> window).WasmWebService_NotifyError = (<any> window).StoneFrameworkModule.cwrap('WasmWebService_NotifyError', null, ['number', 'string', 'number']); | 98 (<any> window).WasmWebService_NotifyError = (<any> window).StoneFrameworkModule.cwrap('WasmWebService_NotifyError', null, ['number', 'string', 'number']); |
98 (<any> window).WasmDelayedCallExecutor_ExecuteCallback = (<any> window).StoneFrameworkModule.cwrap('WasmDelayedCallExecutor_ExecuteCallback', null, ['number']); | 99 (<any> window).WasmDelayedCallExecutor_ExecuteCallback = (<any> window).StoneFrameworkModule.cwrap('WasmDelayedCallExecutor_ExecuteCallback', null, ['number']); |
99 // no need to put this into the globals for it's only used in this very module | 100 // no need to put this into the globals for it's only used in this very module |
100 WasmDoAnimation = (<any> window).StoneFrameworkModule.cwrap('WasmDoAnimation', null, []); | 101 WasmDoAnimation = (<any> window).StoneFrameworkModule.cwrap('WasmDoAnimation', null, []); |
101 | 102 |
102 SendMessageToStoneApplication = (<any> window).StoneFrameworkModule.cwrap('SendMessageToStoneApplication', 'string', ['string']); | 103 SendSerializedMessageToStoneApplication = (<any> window).StoneFrameworkModule.cwrap('SendSerializedMessageToStoneApplication', 'string', ['string']); |
104 SendCommandToStoneApplication = (<any> window).StoneFrameworkModule.cwrap('SendCommandToStoneApplication', 'string', ['string']); | |
103 | 105 |
104 console.log("Connecting C++ methods to JS methods - done"); | 106 console.log("Connecting C++ methods to JS methods - done"); |
105 | 107 |
106 // Prevent scrolling | 108 // Prevent scrolling |
107 document.body.addEventListener('touchmove', function (event) { | 109 document.body.addEventListener('touchmove', function (event) { |