Mercurial > hg > orthanc-stone
comparison Platforms/WebAssembly/Defaults.h @ 223:d30a10d574ec am
refactoring continued - not working
author | am@osimis.io |
---|---|
date | Thu, 14 Jun 2018 10:57:02 +0200 |
parents | 84844649a8fd |
children | c8f11437a6fd |
comparison
equal
deleted
inserted
replaced
222:84844649a8fd | 223:d30a10d574ec |
---|---|
1 #pragma once | 1 #pragma once |
2 | |
3 #include <emscripten/emscripten.h> | |
2 | 4 |
3 #include <Framework/dev.h> | 5 #include <Framework/dev.h> |
4 #include <Framework/Viewport/WidgetViewport.h> | 6 #include <Framework/Viewport/WidgetViewport.h> |
5 #include <Framework/Widgets/LayerWidget.h> | 7 #include <Framework/Widgets/LayerWidget.h> |
6 #include <Framework/Widgets/LayoutWidget.h> | 8 #include <Framework/Widgets/LayoutWidget.h> |
9 #include <Applications/Wasm/BasicWasmApplication.h> | |
10 #include <Applications/Wasm/BasicWasmApplicationContext.h> | |
7 | 11 |
8 #ifdef __cplusplus | 12 #ifdef __cplusplus |
9 extern "C" { | 13 extern "C" { |
10 #endif | 14 #endif |
11 | 15 |
16 // JS methods accessible from C++ | |
12 extern void ScheduleRedraw(); | 17 extern void ScheduleRedraw(); |
13 | 18 |
19 // C++ methods accessible from JS | |
20 extern void EMSCRIPTEN_KEEPALIVE CreateWasmApplication(); | |
21 // extern void EMSCRIPTEN_KEEPALIVE SetStartupParameter(const char* keyc, const char* value); | |
22 // extern void EMSCRIPTEN_KEEPALIVE StartWasmApplication(); | |
23 | |
14 #ifdef __cplusplus | 24 #ifdef __cplusplus |
15 } | 25 } |
16 #endif | 26 #endif |
17 | 27 |
28 extern OrthancStone::BasicWasmApplication* CreateUserApplication(); | |
18 | 29 |
19 namespace OrthancStone { | 30 namespace OrthancStone { |
20 | 31 |
32 // default Ovserver to trigger Viewport redraw when something changes in the Viewport | |
21 class ChangeObserver : | 33 class ChangeObserver : |
22 public OrthancStone::IViewport::IObserver | 34 public OrthancStone::IViewport::IObserver |
23 { | 35 { |
24 private: | 36 private: |
25 // Flag to avoid flooding JavaScript with redundant Redraw requests | 37 // Flag to avoid flooding JavaScript with redundant Redraw requests |
44 isScheduled_ = true; | 56 isScheduled_ = true; |
45 } | 57 } |
46 } | 58 } |
47 }; | 59 }; |
48 | 60 |
49 | 61 // default status bar to log messages on the console/stdout |
50 class StatusBar : public OrthancStone::IStatusBar | 62 class StatusBar : public OrthancStone::IStatusBar |
51 { | 63 { |
52 public: | 64 public: |
53 virtual void ClearMessage() | 65 virtual void ClearMessage() |
54 { | 66 { |