Mercurial > hg > orthanc-stone
annotate Framework/Viewport/WidgetViewport.h @ 391:021480604c92
rename
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 09 Nov 2018 17:41:46 +0100 |
parents | e33659decec5 |
children | b70e9be013e4 |
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 | |
134
4cff7b1ed31d
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
5 * Copyright (C) 2017-2018 Osimis S.A., 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 "IViewport.h" | |
25 #include "../Widgets/IWidget.h" | |
26 | |
53
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
27 #include <memory> |
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
48
diff
changeset
|
28 |
0 | 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 WidgetViewport : public IViewport |
0 | 32 { |
33 private: | |
34 std::auto_ptr<IWidget> centralWidget_; | |
35 IStatusBar* statusBar_; | |
36 std::auto_ptr<IMouseTracker> mouseTracker_; | |
37 bool isMouseOver_; | |
38 int lastMouseX_; | |
39 int lastMouseY_; | |
40 CairoSurface background_; | |
41 bool backgroundChanged_; | |
42 | |
43 public: | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
330
diff
changeset
|
44 WidgetViewport(MessageBroker& broker); |
0 | 45 |
330 | 46 virtual void FitContent(); |
0 | 47 |
48 virtual void SetStatusBar(IStatusBar& statusBar); | |
49 | |
50 IWidget& SetCentralWidget(IWidget* widget); // Takes ownership | |
51 | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
330
diff
changeset
|
52 virtual void NotifyBackgroundChanged(); |
0 | 53 |
54 virtual void SetSize(unsigned int width, | |
55 unsigned int height); | |
56 | |
57 virtual bool Render(Orthanc::ImageAccessor& surface); | |
58 | |
59 virtual void MouseDown(MouseButton button, | |
60 int x, | |
61 int y, | |
62 KeyboardModifiers modifiers); | |
63 | |
64 virtual void MouseUp(); | |
65 | |
66 virtual void MouseMove(int x, | |
67 int y); | |
68 | |
69 virtual void MouseEnter(); | |
70 | |
71 virtual void MouseLeave(); | |
72 | |
73 virtual void MouseWheel(MouseWheelDirection direction, | |
74 int x, | |
75 int y, | |
76 KeyboardModifiers modifiers); | |
77 | |
327 | 78 virtual void KeyPressed(KeyboardKeys key, |
79 char keyChar, | |
0 | 80 KeyboardModifiers modifiers); |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
81 |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
82 virtual bool HasAnimation(); |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
83 |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
84 virtual void DoAnimation(); |
0 | 85 }; |
86 } |