annotate Applications/Samples/SampleApplicationBase.h @ 242:092db46c6291 am

improved SDL/Wasm unification
author am@osimis.io
date Wed, 20 Jun 2018 14:20:55 +0200
parents b4642964c355
children dc1beee33134
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
134
4cff7b1ed31d upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 51
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
10 * the License, or (at your option) any later version.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
15 * Affero General Public License for more details.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
16 *
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
24 //#if ORTHANC_ENABLE_SDL==1
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
25 //#include "../../Applications/Sdl/BasicSdlApplication.h"
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
26 //#else
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
27 //#include "../../Applications/Wasm/BasicWasmApplication.h"
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
28 //#endif
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
29 #include "../../Applications/IBasicApplication.h"
235
ce4405d98b92 Added SimpleViewerApplication (working in SDL)
am@osimis.io
parents: 221
diff changeset
30 #include "../../Framework/Viewport/WidgetViewport.h"
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
31 //#include "SampleApplicationContext.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 namespace OrthancStone
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 namespace Samples
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
37
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
38 //#if ORTHANC_ENABLE_SDL==1
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
39 // class SampleSdlApplicationBase : public BasicSdlApplication {
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
40 // protected:
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
41 // public:
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
42 // virtual BasicApplicationContext& CreateApplicationContext(Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport) {
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
43 // context_.reset(new SampleApplicationContext(orthanc, centralViewport));
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
44
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
45 // return *context_;
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
46 // }
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
47 // };
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
48
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
49 // typedef SampleSdlApplicationBase SampleApplicationBase_;
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
50 //#else
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
51 // class SampleWasmApplicationBase : public BasicWasmApplication {
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
52 // protected:
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
53 // std::unique_ptr<SampleApplicationContext> context_;
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
54 // public:
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
55 // virtual BasicApplicationContext& CreateApplicationContext(IWebService& orthancWebService, std::shared_ptr<WidgetViewport> centralViewport) {
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
56 // context_.reset(new SampleApplicationContext(orthancWebService));
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
57 // return *context_;
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
58 // }
237
b4642964c355 SimpleViewer demo running both with SDL and Wasm
am@osimis.io
parents: 235
diff changeset
59
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
60 // };
237
b4642964c355 SimpleViewer demo running both with SDL and Wasm
am@osimis.io
parents: 235
diff changeset
61
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
62 // typedef SampleWasmApplicationBase SampleApplicationBase_;
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
63
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
64 //#endif
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
65
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
66 class SampleApplicationBase : public IBasicApplication
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 public:
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 virtual std::string GetTitle() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 return "Stone of Orthanc - Sample";
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
73
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
74 virtual void CustomInitialize() {}
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 237
diff changeset
75
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
76 };
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
78
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 }