Mercurial > hg > orthanc-stone
annotate Platforms/Wasm/Defaults.cpp @ 1268:9a0a95c0b578
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 31 Jan 2020 17:25:27 +0100 |
parents | 92a043b8e431 |
children |
rev | line source |
---|---|
222 | 1 #include "Defaults.h" |
2 | |
223 | 3 #include "WasmWebService.h" |
431
26b90b110719
added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
am@osimis.io
parents:
418
diff
changeset
|
4 #include "WasmDelayedCallExecutor.h" |
732
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
726
diff
changeset
|
5 #include "../../Framework/Deprecated/Widgets/TestCairoWidget.h" |
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
726
diff
changeset
|
6 #include <Framework/Deprecated/Viewport/WidgetViewport.h> |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
7 #include <Applications/Wasm/StartupParametersBuilder.h> |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
8 #include <Platforms/Wasm/WasmPlatformApplicationAdapter.h> |
991
92a043b8e431
removed logs from IObserver constructor
Alain Mazy <alain@mazy.be>
parents:
878
diff
changeset
|
9 #include <Framework/StoneInitialization.h> |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
10 #include <Core/Logging.h> |
991
92a043b8e431
removed logs from IObserver constructor
Alain Mazy <alain@mazy.be>
parents:
878
diff
changeset
|
11 #include <sstream> |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
12 |
228 | 13 #include <algorithm> |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
14 |
223 | 15 |
16 static unsigned int width_ = 0; | |
17 static unsigned int height_ = 0; | |
18 | |
19 /**********************************/ | |
20 | |
288 | 21 static std::unique_ptr<OrthancStone::IStoneApplication> application; |
307 | 22 static std::unique_ptr<OrthancStone::WasmPlatformApplicationAdapter> applicationWasmAdapter = NULL; |
288 | 23 static std::unique_ptr<OrthancStone::StoneApplicationContext> context; |
242 | 24 static OrthancStone::StartupParametersBuilder startupParametersBuilder; |
253 | 25 static OrthancStone::MessageBroker broker; |
242 | 26 |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
327
diff
changeset
|
27 static OrthancStone::ViewportContentChangedObserver viewportContentChangedObserver_(broker); |
223 | 28 static OrthancStone::StatusBar statusBar_; |
29 | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
30 static std::list<std::shared_ptr<Deprecated::WidgetViewport>> viewports_; |
227 | 31 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
32 std::shared_ptr<Deprecated::WidgetViewport> FindViewportSharedPtr(ViewportHandle viewport) { |
228 | 33 for (const auto& v : viewports_) { |
34 if (v.get() == viewport) { | |
35 return v; | |
36 } | |
37 } | |
229 | 38 assert(false); |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
39 return std::shared_ptr<Deprecated::WidgetViewport>(); |
228 | 40 } |
41 | |
223 | 42 #ifdef __cplusplus |
43 extern "C" { | |
44 #endif | |
45 | |
877
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
46 #if 0 |
878 | 47 // rewrite malloc/free in order to monitor allocations. We actually only monitor large allocations (like images ...) |
48 | |
877
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
49 size_t bigChunksTotalSize = 0; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
50 std::map<void*, size_t> allocatedBigChunks; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
51 |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
52 extern void* emscripten_builtin_malloc(size_t bytes); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
53 extern void emscripten_builtin_free(void* mem); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
54 |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
55 void * __attribute__((noinline)) malloc(size_t size) |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
56 { |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
57 void *ptr = emscripten_builtin_malloc(size); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
58 if (size > 100000) |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
59 { |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
60 bigChunksTotalSize += size; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
61 printf("++ Allocated %zu bytes, got %p. (%zu MB consumed by big chunks)\n", size, ptr, bigChunksTotalSize/(1024*1024)); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
62 allocatedBigChunks[ptr] = size; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
63 } |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
64 return ptr; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
65 } |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
66 |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
67 void __attribute__((noinline)) free(void *ptr) |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
68 { |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
69 emscripten_builtin_free(ptr); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
70 |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
71 std::map<void*, size_t>::iterator it = allocatedBigChunks.find(ptr); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
72 if (it != allocatedBigChunks.end()) |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
73 { |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
74 bigChunksTotalSize -= it->second; |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
75 printf("-- Freed %zu bytes at %p. (%zu MB consumed by big chunks)\n", it->second, ptr, bigChunksTotalSize/(1024*1024)); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
76 allocatedBigChunks.erase(it); |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
77 } |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
78 } |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
79 #endif // 0 |
f7e5ee59ba17
debug code to monitor large malloc/free (currently disabled)
Alain Mazy <alain@mazy.be>
parents:
860
diff
changeset
|
80 |
223 | 81 using namespace OrthancStone; |
227 | 82 |
83 // when WASM needs a C++ viewport | |
84 ViewportHandle EMSCRIPTEN_KEEPALIVE CreateCppViewport() { | |
85 | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
86 std::shared_ptr<Deprecated::WidgetViewport> viewport(new Deprecated::WidgetViewport(broker)); |
287 | 87 printf("viewport %x\n", (int)viewport.get()); |
227 | 88 |
89 viewports_.push_back(viewport); | |
90 | |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
91 printf("There are now %lu viewports in C++\n", viewports_.size()); |
227 | 92 |
93 viewport->SetStatusBar(statusBar_); | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
327
diff
changeset
|
94 |
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
327
diff
changeset
|
95 viewport->RegisterObserverCallback( |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
96 new Callable<ViewportContentChangedObserver, Deprecated::IViewport::ViewportChangedMessage> |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
327
diff
changeset
|
97 (viewportContentChangedObserver_, &ViewportContentChangedObserver::OnViewportChanged)); |
227 | 98 |
99 return viewport.get(); | |
100 } | |
101 | |
102 // when WASM does not need a viewport anymore, it should release it | |
103 void EMSCRIPTEN_KEEPALIVE ReleaseCppViewport(ViewportHandle viewport) { | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
104 viewports_.remove_if([viewport](const std::shared_ptr<Deprecated::WidgetViewport>& v) { return v.get() == viewport;}); |
227 | 105 |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
106 printf("There are now %lu viewports in C++\n", viewports_.size()); |
227 | 107 } |
108 | |
109 void EMSCRIPTEN_KEEPALIVE CreateWasmApplication(ViewportHandle viewport) { | |
991
92a043b8e431
removed logs from IObserver constructor
Alain Mazy <alain@mazy.be>
parents:
878
diff
changeset
|
110 printf("Initializing Stone\n"); |
92a043b8e431
removed logs from IObserver constructor
Alain Mazy <alain@mazy.be>
parents:
878
diff
changeset
|
111 OrthancStone::StoneInitialize(); |
223 | 112 printf("CreateWasmApplication\n"); |
113 | |
253 | 114 application.reset(CreateUserApplication(broker)); |
307 | 115 applicationWasmAdapter.reset(CreateWasmApplicationAdapter(broker, application.get())); |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
116 Deprecated::WasmWebService::SetBroker(broker); |
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
117 Deprecated::WasmDelayedCallExecutor::SetBroker(broker); |
223 | 118 |
242 | 119 startupParametersBuilder.Clear(); |
223 | 120 } |
121 | |
122 void EMSCRIPTEN_KEEPALIVE SetStartupParameter(const char* keyc, | |
123 const char* value) { | |
242 | 124 startupParametersBuilder.SetStartupParameter(keyc, value); |
223 | 125 } |
126 | |
418 | 127 void EMSCRIPTEN_KEEPALIVE StartWasmApplication(const char* baseUri) { |
223 | 128 |
129 printf("StartWasmApplication\n"); | |
130 | |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
131 Orthanc::Logging::SetErrorWarnInfoTraceLoggingFunctions( |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
132 stone_console_error, stone_console_warning, |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
133 stone_console_info, stone_console_trace); |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
134 |
223 | 135 // recreate a command line from uri arguments and parse it |
136 boost::program_options::variables_map parameters; | |
242 | 137 boost::program_options::options_description options; |
138 application->DeclareStartupOptions(options); | |
139 startupParametersBuilder.GetStartupParameters(parameters, options); | |
223 | 140 |
418 | 141 context.reset(new OrthancStone::StoneApplicationContext(broker)); |
142 context->SetOrthancBaseUrl(baseUri); | |
143 printf("Base URL to Orthanc API: [%s]\n", baseUri); | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
144 context->SetWebService(Deprecated::WasmWebService::GetInstance()); |
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
145 context->SetDelayedCallExecutor(Deprecated::WasmDelayedCallExecutor::GetInstance()); |
242 | 146 application->Initialize(context.get(), statusBar_, parameters); |
147 application->InitializeWasm(); | |
223 | 148 |
231
5027cb2feb51
viewport is now part of the Application itself and not global anymore
am@osimis.io
parents:
229
diff
changeset
|
149 // viewport->SetSize(width_, height_); |
223 | 150 printf("StartWasmApplication - completed\n"); |
151 } | |
152 | |
603
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
153 bool EMSCRIPTEN_KEEPALIVE WasmIsTraceLevelEnabled() |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
154 { |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
155 return Orthanc::Logging::IsTraceLevelEnabled(); |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
156 } |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
157 |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
158 bool EMSCRIPTEN_KEEPALIVE WasmIsInfoLevelEnabled() |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
159 { |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
160 return Orthanc::Logging::IsInfoLevelEnabled(); |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
161 } |
70992b38aa8a
new routable logging system in STDIO mode + flag support (with no value) in StartupParametersBuilder + 80 col indent
Benjamin Golinvaux <bgo@osimis.io>
parents:
535
diff
changeset
|
162 |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
163 void EMSCRIPTEN_KEEPALIVE WasmDoAnimation() |
223 | 164 { |
228 | 165 for (auto viewport : viewports_) { |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
166 // TODO Only launch the JavaScript timer if "HasAnimation()" |
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
167 if (viewport->HasAnimation()) |
228 | 168 { |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
169 viewport->DoAnimation(); |
228 | 170 } |
171 | |
223 | 172 } |
173 | |
174 } | |
175 | |
176 | |
228 | 177 void EMSCRIPTEN_KEEPALIVE ViewportSetSize(ViewportHandle viewport, unsigned int width, unsigned int height) |
223 | 178 { |
179 width_ = width; | |
180 height_ = height; | |
181 | |
228 | 182 viewport->SetSize(width, height); |
223 | 183 } |
184 | |
228 | 185 int EMSCRIPTEN_KEEPALIVE ViewportRender(ViewportHandle viewport, |
227 | 186 unsigned int width, |
223 | 187 unsigned int height, |
188 uint8_t* data) | |
189 { | |
278 | 190 viewportContentChangedObserver_.Reset(); |
223 | 191 |
192 //printf("ViewportRender called %dx%d\n", width, height); | |
193 if (width == 0 || | |
194 height == 0) | |
195 { | |
196 return 1; | |
197 } | |
198 | |
199 Orthanc::ImageAccessor surface; | |
200 surface.AssignWritable(Orthanc::PixelFormat_BGRA32, width, height, 4 * width, data); | |
201 | |
227 | 202 viewport->Render(surface); |
223 | 203 |
204 // Convert from BGRA32 memory layout (only color mode supported by | |
205 // Cairo, which corresponds to CAIRO_FORMAT_ARGB32) to RGBA32 (as | |
206 // expected by HTML5 canvas). This simply amounts to swapping the | |
207 // B and R channels. | |
208 uint8_t* p = data; | |
209 for (unsigned int y = 0; y < height; y++) { | |
210 for (unsigned int x = 0; x < width; x++) { | |
211 uint8_t tmp = p[0]; | |
212 p[0] = p[2]; | |
213 p[2] = tmp; | |
214 | |
215 p += 4; | |
216 } | |
217 } | |
218 | |
219 return 1; | |
220 } | |
221 | |
222 | |
228 | 223 void EMSCRIPTEN_KEEPALIVE ViewportMouseDown(ViewportHandle viewport, |
224 unsigned int rawButton, | |
223 | 225 int x, |
226 int y, | |
227 unsigned int rawModifiers) | |
228 { | |
229 OrthancStone::MouseButton button; | |
230 switch (rawButton) | |
231 { | |
232 case 0: | |
233 button = OrthancStone::MouseButton_Left; | |
234 break; | |
235 | |
236 case 1: | |
237 button = OrthancStone::MouseButton_Middle; | |
238 break; | |
239 | |
240 case 2: | |
241 button = OrthancStone::MouseButton_Right; | |
242 break; | |
243 | |
244 default: | |
245 return; // Unknown button | |
246 } | |
247 | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
248 viewport->MouseDown(button, x, y, OrthancStone::KeyboardModifiers_None, std::vector<Deprecated::Touch>()); |
223 | 249 } |
250 | |
251 | |
228 | 252 void EMSCRIPTEN_KEEPALIVE ViewportMouseWheel(ViewportHandle viewport, |
253 int deltaY, | |
223 | 254 int x, |
255 int y, | |
256 int isControl) | |
257 { | |
228 | 258 if (deltaY != 0) |
223 | 259 { |
260 OrthancStone::MouseWheelDirection direction = (deltaY < 0 ? | |
261 OrthancStone::MouseWheelDirection_Up : | |
262 OrthancStone::MouseWheelDirection_Down); | |
263 OrthancStone::KeyboardModifiers modifiers = OrthancStone::KeyboardModifiers_None; | |
264 | |
265 if (isControl != 0) | |
266 { | |
267 modifiers = OrthancStone::KeyboardModifiers_Control; | |
268 } | |
269 | |
228 | 270 viewport->MouseWheel(direction, x, y, modifiers); |
223 | 271 } |
272 } | |
273 | |
274 | |
228 | 275 void EMSCRIPTEN_KEEPALIVE ViewportMouseMove(ViewportHandle viewport, |
276 int x, | |
223 | 277 int y) |
278 { | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
279 viewport->MouseMove(x, y, std::vector<Deprecated::Touch>()); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
280 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
281 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
282 void GetTouchVector(std::vector<Deprecated::Touch>& output, |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
283 int touchCount, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
284 float x0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
285 float y0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
286 float x1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
287 float y1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
288 float x2, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
289 float y2) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
290 { |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
291 // TODO: it might be nice to try to pass all the x0,y0 coordinates as arrays but that's not so easy to pass array between JS and C++ |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
292 if (touchCount > 0) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
293 { |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
294 output.push_back(Deprecated::Touch(x0, y0)); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
295 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
296 if (touchCount > 1) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
297 { |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
298 output.push_back(Deprecated::Touch(x1, y1)); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
299 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
300 if (touchCount > 2) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
301 { |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
302 output.push_back(Deprecated::Touch(x2, y2)); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
303 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
304 |
223 | 305 } |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
306 |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
307 void EMSCRIPTEN_KEEPALIVE ViewportTouchStart(ViewportHandle viewport, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
308 int touchCount, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
309 float x0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
310 float y0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
311 float x1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
312 float y1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
313 float x2, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
314 float y2) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
315 { |
838 | 316 // printf("touch start with %d touches\n", touchCount); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
317 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
318 std::vector<Deprecated::Touch> touches; |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
319 GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
320 viewport->TouchStart(touches); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
321 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
322 |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
323 void EMSCRIPTEN_KEEPALIVE ViewportTouchMove(ViewportHandle viewport, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
324 int touchCount, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
325 float x0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
326 float y0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
327 float x1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
328 float y1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
329 float x2, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
330 float y2) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
331 { |
838 | 332 // printf("touch move with %d touches\n", touchCount); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
333 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
334 std::vector<Deprecated::Touch> touches; |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
335 GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
336 viewport->TouchMove(touches); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
337 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
338 |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
339 void EMSCRIPTEN_KEEPALIVE ViewportTouchEnd(ViewportHandle viewport, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
340 int touchCount, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
341 float x0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
342 float y0, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
343 float x1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
344 float y1, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
345 float x2, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
346 float y2) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
347 { |
838 | 348 // printf("touch end with %d touches remaining\n", touchCount); |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
349 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
603
diff
changeset
|
350 std::vector<Deprecated::Touch> touches; |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
351 GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
352 viewport->TouchEnd(touches); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
353 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
431
diff
changeset
|
354 |
228 | 355 void EMSCRIPTEN_KEEPALIVE ViewportKeyPressed(ViewportHandle viewport, |
327 | 356 int key, |
357 const char* keyChar, | |
223 | 358 bool isShiftPressed, |
359 bool isControlPressed, | |
360 bool isAltPressed) | |
361 | |
362 { | |
228 | 363 OrthancStone::KeyboardModifiers modifiers = OrthancStone::KeyboardModifiers_None; |
364 if (isShiftPressed) { | |
365 modifiers = static_cast<OrthancStone::KeyboardModifiers>(modifiers + OrthancStone::KeyboardModifiers_Shift); | |
223 | 366 } |
228 | 367 if (isControlPressed) { |
368 modifiers = static_cast<OrthancStone::KeyboardModifiers>(modifiers + OrthancStone::KeyboardModifiers_Control); | |
369 } | |
370 if (isAltPressed) { | |
371 modifiers = static_cast<OrthancStone::KeyboardModifiers>(modifiers + OrthancStone::KeyboardModifiers_Alt); | |
372 } | |
327 | 373 |
374 char c = 0; | |
375 if (keyChar != NULL && key == OrthancStone::KeyboardKeys_Generic) { | |
376 c = keyChar[0]; | |
377 } | |
378 viewport->KeyPressed(static_cast<OrthancStone::KeyboardKeys>(key), c, modifiers); | |
223 | 379 } |
380 | |
381 | |
228 | 382 void EMSCRIPTEN_KEEPALIVE ViewportMouseUp(ViewportHandle viewport) |
223 | 383 { |
228 | 384 viewport->MouseUp(); |
223 | 385 } |
386 | |
387 | |
228 | 388 void EMSCRIPTEN_KEEPALIVE ViewportMouseEnter(ViewportHandle viewport) |
223 | 389 { |
228 | 390 viewport->MouseEnter(); |
223 | 391 } |
392 | |
393 | |
228 | 394 void EMSCRIPTEN_KEEPALIVE ViewportMouseLeave(ViewportHandle viewport) |
223 | 395 { |
228 | 396 viewport->MouseLeave(); |
223 | 397 } |
398 | |
508
7105a0bad250
- Added HandleSerializedMessage to IStoneApplication (empty impl)
Benjamin Golinvaux <bgo@osimis.io>
parents:
458
diff
changeset
|
399 const char* EMSCRIPTEN_KEEPALIVE SendSerializedMessageToStoneApplication(const char* message) |
287 | 400 { |
401 static std::string output; // we don't want the string to be deallocated when we return to JS code so we always use the same string (this is fine since JS is single-thread) | |
402 | |
838 | 403 //printf("SendSerializedMessageToStoneApplication\n"); |
404 //printf("%s", message); | |
307 | 405 |
406 if (applicationWasmAdapter.get() != NULL) { | |
508
7105a0bad250
- Added HandleSerializedMessage to IStoneApplication (empty impl)
Benjamin Golinvaux <bgo@osimis.io>
parents:
458
diff
changeset
|
407 applicationWasmAdapter->HandleSerializedMessageFromWeb(output, std::string(message)); |
287 | 408 return output.c_str(); |
409 } | |
838 | 410 printf("This Stone application does not have a Web Adapter, unable to send messages"); |
307 | 411 return NULL; |
287 | 412 } |
413 | |
223 | 414 #ifdef __cplusplus |
415 } | |
416 #endif |