comparison Applications/Samples/SimpleViewerApplicationSingleFile.h @ 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 22b80f5c3a1c
children 700aa66f2f29
comparison
equal deleted inserted replaced
507:ce49eae4c887 508:7105a0bad250
203 : WasmPlatformApplicationAdapter(broker, application), 203 : WasmPlatformApplicationAdapter(broker, application),
204 viewerApplication_(application) 204 viewerApplication_(application)
205 { 205 {
206 } 206 }
207 207
208 virtual void HandleMessageFromWeb(std::string& output, const std::string& input) 208 virtual void HandleSerializedMessageFromWeb(std::string& output, const std::string& input)
209 {
210 // the simple viewer does not use the serialized messages facilities
211 }
212
213 virtual void HandleCommandFromWeb(std::string& output, const std::string& input)
209 { 214 {
210 if (input == "select-tool:line-measure") 215 if (input == "select-tool:line-measure")
211 { 216 {
212 viewerApplication_.currentTool_ = Tools_LineMeasure; 217 viewerApplication_.currentTool_ = Tools_LineMeasure;
213 NotifyStatusUpdateFromCppToWeb("currentTool=line-measure"); 218 NotifyStatusUpdateFromCppToWeb("currentTool=line-measure");
219 } 224 }
220 225
221 output = "ok"; 226 output = "ok";
222 } 227 }
223 228
229 virtual void NotifySerializedMessageFromCppToWeb(const std::string& statusUpdateMessage)
230 {
231 UpdateStoneApplicationStatusFromCppWithSerializedMessage(statusUpdateMessage.c_str());
232 }
233
224 virtual void NotifyStatusUpdateFromCppToWeb(const std::string& statusUpdateMessage) 234 virtual void NotifyStatusUpdateFromCppToWeb(const std::string& statusUpdateMessage)
225 { 235 {
226 UpdateStoneApplicationStatusFromCpp(statusUpdateMessage.c_str()); 236 UpdateStoneApplicationStatusFromCppWithString(statusUpdateMessage.c_str());
227 } 237 }
228 238
229 }; 239 };
230 #endif 240 #endif
231 enum Tools { 241 enum Tools {