annotate Resources/CodeGeneration/testWasmIntegrated/main.cpp @ 498:6d62fc8a6988 bgo-commands-codegen

Web demonstrator for codegen ongoing work
author bgo-osimis
date Sun, 24 Feb 2019 13:23:14 +0100
parents 8b6ceae45ba0
children baa9e1e932db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
1 #include <iostream>
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
2 #include <emscripten/emscripten.h>
495
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
3
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
4 int main()
6405435480ae Fixed template to add dump capabilities + started work on an integrated TS/WASM test
bgo-osimis
parents:
diff changeset
5 {
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
6 std::cout << "Hello world from testWasmIntegrated! (this is sent from C++)" << std::endl;
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
7 }
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
8
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
9 extern "C" void SendMessageFromCppJS(std::string message);
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
10 extern "C" void SendFreeTextFromCppJS(std::string message);
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
11
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
12 void EMSCRIPTEN_KEEPALIVE StartWasmApplication(const char* baseUri)
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
13 {
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
14 printf("Hello! (this is sent from C++)\n");
496
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
15
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
16 // // recreate a command line from uri arguments and parse it
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
17 // boost::program_options::variables_map parameters;
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
18 // boost::program_options::options_description options;
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
19 // application->DeclareStartupOptions(options);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
20 // startupParametersBuilder.GetStartupParameters(parameters, options);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
21
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
22 // context.reset(new OrthancStone::StoneApplicationContext(broker));
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
23 // context->SetOrthancBaseUrl(baseUri);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
24 // printf("Base URL to Orthanc API: [%s]\n", baseUri);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
25 // context->SetWebService(OrthancStone::WasmWebService::GetInstance());
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
26 // context->SetDelayedCallExecutor(OrthancStone::WasmDelayedCallExecutor::GetInstance());
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
27 // application->Initialize(context.get(), statusBar_, parameters);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
28 // application->InitializeWasm();
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
29
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
30 // // viewport->SetSize(width_, height_);
8b6ceae45ba0 Finished (untested) C++, html, typescript, tsc & browserify production.
bgo-osimis
parents: 495
diff changeset
31 // printf("StartWasmApplication - completed\n");
498
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
32 SendFreeTextFromCppJS("Hello world from C++!");
6d62fc8a6988 Web demonstrator for codegen ongoing work
bgo-osimis
parents: 496
diff changeset
33 }