Mercurial > hg > orthanc-stone
comparison Platforms/Wasm/Defaults.cpp @ 278:8a86695fcbc3 am-2
renamings
author | am@osimis.io |
---|---|
date | Mon, 27 Aug 2018 14:58:37 +0200 |
parents | d7d91d96b9d8 |
children | 2038d76bf13f |
comparison
equal
deleted
inserted
replaced
277:a38465cc909f | 278:8a86695fcbc3 |
---|---|
16 static std::unique_ptr<OrthancStone::IBasicApplication> application; | 16 static std::unique_ptr<OrthancStone::IBasicApplication> application; |
17 static std::unique_ptr<OrthancStone::BasicApplicationContext> context; | 17 static std::unique_ptr<OrthancStone::BasicApplicationContext> context; |
18 static OrthancStone::StartupParametersBuilder startupParametersBuilder; | 18 static OrthancStone::StartupParametersBuilder startupParametersBuilder; |
19 static OrthancStone::MessageBroker broker; | 19 static OrthancStone::MessageBroker broker; |
20 | 20 |
21 static OrthancStone::ChangeObserver changeObserver_; | 21 static OrthancStone::ViewportContentChangedObserver viewportContentChangedObserver_; |
22 static OrthancStone::StatusBar statusBar_; | 22 static OrthancStone::StatusBar statusBar_; |
23 | 23 |
24 static std::list<std::shared_ptr<OrthancStone::WidgetViewport>> viewports_; | 24 static std::list<std::shared_ptr<OrthancStone::WidgetViewport>> viewports_; |
25 | 25 |
26 std::shared_ptr<OrthancStone::WidgetViewport> FindViewportSharedPtr(ViewportHandle viewport) { | 26 std::shared_ptr<OrthancStone::WidgetViewport> FindViewportSharedPtr(ViewportHandle viewport) { |
48 viewports_.push_back(viewport); | 48 viewports_.push_back(viewport); |
49 | 49 |
50 printf("There are now %d viewports in C++\n", viewports_.size()); | 50 printf("There are now %d viewports in C++\n", viewports_.size()); |
51 | 51 |
52 viewport->SetStatusBar(statusBar_); | 52 viewport->SetStatusBar(statusBar_); |
53 viewport->Register(changeObserver_); | 53 viewport->Register(viewportContentChangedObserver_); |
54 | 54 |
55 return viewport.get(); | 55 return viewport.get(); |
56 } | 56 } |
57 | 57 |
58 // when WASM does not need a viewport anymore, it should release it | 58 // when WASM does not need a viewport anymore, it should release it |
121 int EMSCRIPTEN_KEEPALIVE ViewportRender(ViewportHandle viewport, | 121 int EMSCRIPTEN_KEEPALIVE ViewportRender(ViewportHandle viewport, |
122 unsigned int width, | 122 unsigned int width, |
123 unsigned int height, | 123 unsigned int height, |
124 uint8_t* data) | 124 uint8_t* data) |
125 { | 125 { |
126 changeObserver_.Reset(); | 126 viewportContentChangedObserver_.Reset(); |
127 | 127 |
128 //printf("ViewportRender called %dx%d\n", width, height); | 128 //printf("ViewportRender called %dx%d\n", width, height); |
129 if (width == 0 || | 129 if (width == 0 || |
130 height == 0) | 130 height == 0) |
131 { | 131 { |