Mercurial > hg > orthanc-stone
annotate Framework/Viewport/IViewport.h @ 81:8677d95753f8 wasm
switching to Oracle in SDL samples
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 22:54:09 +0200 |
parents | 298f375dcb68 |
children | 02c3a7a4938f |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
40
7207a407bcd8
shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
16
diff
changeset
|
5 * Copyright (C) 2017 Osimis, Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
47 | 8 * modify it under the terms of the GNU Affero General Public License |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
0 | 11 * |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
47 | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
0 | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "IStatusBar.h" | |
25 #include "../Enumerations.h" | |
26 | |
16 | 27 #include "../../Resources/Orthanc/Core/Images/ImageAccessor.h" |
0 | 28 |
29 namespace OrthancStone | |
30 { | |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
31 class IWidget; // Forward declaration |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
32 |
53
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
33 class IViewport : public boost::noncopyable |
0 | 34 { |
35 public: | |
36 class IChangeObserver : public boost::noncopyable | |
37 { | |
38 public: | |
39 virtual ~IChangeObserver() | |
40 { | |
41 } | |
42 | |
43 virtual void NotifyChange(const IViewport& scene) = 0; | |
44 }; | |
45 | |
53
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
46 virtual ~IViewport() |
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
47 { |
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
48 } |
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
49 |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
50 virtual void SetDefaultView() = 0; |
0 | 51 |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
52 virtual void Register(IChangeObserver& observer) = 0; |
0 | 53 |
54 virtual void SetStatusBar(IStatusBar& statusBar) = 0; | |
55 | |
56 virtual void SetSize(unsigned int width, | |
57 unsigned int height) = 0; | |
58 | |
59 // The function returns "true" iff. a new frame was rendered | |
60 virtual bool Render(Orthanc::ImageAccessor& surface) = 0; | |
61 | |
62 virtual void MouseDown(MouseButton button, | |
63 int x, | |
64 int y, | |
65 KeyboardModifiers modifiers) = 0; | |
66 | |
67 virtual void MouseUp() = 0; | |
68 | |
69 virtual void MouseMove(int x, | |
70 int y) = 0; | |
71 | |
72 virtual void MouseEnter() = 0; | |
73 | |
74 virtual void MouseLeave() = 0; | |
75 | |
76 virtual void MouseWheel(MouseWheelDirection direction, | |
77 int x, | |
78 int y, | |
79 KeyboardModifiers modifiers) = 0; | |
80 | |
81 virtual void KeyPressed(char key, | |
82 KeyboardModifiers modifiers) = 0; | |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
83 |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
84 virtual bool HasUpdateContent() = 0; |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
85 |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
86 virtual void UpdateContent() = 0; |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
87 |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
88 // Should only be called from IWidget |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
89 virtual void NotifyChange(const IWidget& widget) = 0; |
66 | 90 |
91 virtual void Start() = 0; | |
0 | 92 }; |
93 } |