Mercurial > hg > orthanc-stone
comparison Deprecated/Platforms/Wasm/default-library.js @ 1400:419d0320c344
moved Platforms into Deprecated
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 29 Apr 2020 20:45:14 +0200 |
parents | Platforms/Wasm/default-library.js@70992b38aa8a |
children |
comparison
equal
deleted
inserted
replaced
1399:ff8d2e46ac63 | 1400:419d0320c344 |
---|---|
1 // this file contains the JS method you want to expose to C++ code | |
2 | |
3 mergeInto(LibraryManager.library, { | |
4 | |
5 ScheduleWebViewportRedrawFromCpp: function(cppViewportHandle) { | |
6 window.ScheduleWebViewportRedraw(cppViewportHandle); | |
7 }, | |
8 | |
9 CreateWasmViewportFromCpp: function(htmlCanvasId) { | |
10 return window.CreateWasmViewport(htmlCanvasId); | |
11 }, | |
12 | |
13 // each time the StoneApplication updates its status, it may signal it | |
14 // through this method. i.e, to change the status of a button in the web interface | |
15 UpdateStoneApplicationStatusFromCppWithString: function(statusUpdateMessage) { | |
16 var statusUpdateMessage_ = UTF8ToString(statusUpdateMessage); | |
17 window.UpdateWebApplicationWithString(statusUpdateMessage_); | |
18 }, | |
19 | |
20 // same, but with a serialized message | |
21 UpdateStoneApplicationStatusFromCppWithSerializedMessage: function(statusUpdateMessage) { | |
22 var statusUpdateMessage_ = UTF8ToString(statusUpdateMessage); | |
23 window.UpdateWebApplicationWithSerializedMessage(statusUpdateMessage_); | |
24 }, | |
25 | |
26 // These functions are called from C++ (through an extern declaration) | |
27 // and call the standard logger that, here, routes to the console. | |
28 | |
29 stone_console_error : function(message) { | |
30 var text = UTF8ToString(message); | |
31 window.errorFromCpp(text); | |
32 }, | |
33 | |
34 stone_console_warning : function(message) { | |
35 var text = UTF8ToString(message); | |
36 window.warningFromCpp(text); | |
37 }, | |
38 | |
39 stone_console_info: function(message) { | |
40 var text = UTF8ToString(message); | |
41 window.infoFromCpp(text); | |
42 }, | |
43 | |
44 stone_console_trace : function(message) { | |
45 var text = UTF8ToString(message); | |
46 window.debugFromCpp(text); | |
47 } | |
48 | |
49 }); |