Mercurial > hg > orthanc-stone
annotate Framework/Deprecated/Viewport/WidgetViewport.cpp @ 925:4639d0bf6390
Added support for Grayscale16 in the multiframe loader (Victor)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 22 Jul 2019 16:00:03 +0200 |
parents | c35e98d22764 |
children | e146743f6cdc 4663f158c748 |
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 | |
439 | 5 * Copyright (C) 2017-2019 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 #include "WidgetViewport.h" | |
23 | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
24 #include <Core/Images/ImageProcessing.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
25 #include <Core/OrthancException.h> |
0 | 26 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
27 namespace Deprecated |
0 | 28 { |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
29 WidgetViewport::WidgetViewport(OrthancStone::MessageBroker& broker) : |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
30 IViewport(broker), |
0 | 31 statusBar_(NULL), |
32 isMouseOver_(false), | |
33 lastMouseX_(0), | |
34 lastMouseY_(0), | |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
35 backgroundChanged_(false) |
0 | 36 { |
37 } | |
38 | |
39 | |
330 | 40 void WidgetViewport::FitContent() |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
41 { |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
42 if (centralWidget_.get() != NULL) |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
43 { |
330 | 44 centralWidget_->FitContent(); |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
45 } |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
46 } |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
47 |
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
48 |
0 | 49 void WidgetViewport::SetStatusBar(IStatusBar& statusBar) |
50 { | |
51 statusBar_ = &statusBar; | |
52 | |
53 if (centralWidget_.get() != NULL) | |
54 { | |
55 centralWidget_->SetStatusBar(statusBar); | |
56 } | |
57 } | |
58 | |
59 | |
60 IWidget& WidgetViewport::SetCentralWidget(IWidget* widget) | |
61 { | |
62 if (widget == NULL) | |
63 { | |
64 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
65 } | |
66 | |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
67 mouseTracker_.reset(NULL); |
222 | 68 |
0 | 69 centralWidget_.reset(widget); |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
70 centralWidget_->SetViewport(*this); |
0 | 71 |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
72 if (statusBar_ != NULL) |
0 | 73 { |
74 centralWidget_->SetStatusBar(*statusBar_); | |
75 } | |
76 | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
77 NotifyBackgroundChanged(); |
0 | 78 |
79 return *widget; | |
80 } | |
81 | |
82 | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
83 void WidgetViewport::NotifyBackgroundChanged() |
0 | 84 { |
85 backgroundChanged_ = true; | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
86 NotifyContentChanged(); |
0 | 87 } |
88 | |
89 | |
90 void WidgetViewport::SetSize(unsigned int width, | |
91 unsigned int height) | |
92 { | |
560
aaeec7be8fb7
add support for alpha channel in CairoSurface
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
93 background_.SetSize(width, height, false /* no alpha */); |
0 | 94 |
95 if (centralWidget_.get() != NULL) | |
96 { | |
97 centralWidget_->SetSize(width, height); | |
98 } | |
99 | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
100 NotifyBackgroundChanged(); |
0 | 101 } |
102 | |
103 | |
104 bool WidgetViewport::Render(Orthanc::ImageAccessor& surface) | |
105 { | |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
106 if (centralWidget_.get() == NULL) |
0 | 107 { |
108 return false; | |
109 } | |
316
ce48c3b3b0e9
fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
110 |
ce48c3b3b0e9
fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
111 Orthanc::ImageAccessor background; |
ce48c3b3b0e9
fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
112 background_.GetWriteableAccessor(background); |
0 | 113 |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
114 if (backgroundChanged_ && |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
115 !centralWidget_->Render(background)) |
0 | 116 { |
117 return false; | |
118 } | |
119 | |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
120 if (background.GetWidth() != surface.GetWidth() || |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
121 background.GetHeight() != surface.GetHeight()) |
0 | 122 { |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
123 return false; |
0 | 124 } |
125 | |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
126 Orthanc::ImageProcessing::Convert(surface, background); |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
127 |
0 | 128 if (mouseTracker_.get() != NULL) |
129 { | |
130 mouseTracker_->Render(surface); | |
131 } | |
132 else if (isMouseOver_) | |
133 { | |
134 centralWidget_->RenderMouseOver(surface, lastMouseX_, lastMouseY_); | |
135 } | |
136 | |
137 return true; | |
138 } | |
139 | |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
140 void WidgetViewport::TouchStart(const std::vector<Touch>& displayTouches) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
141 { |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
142 MouseDown(OrthancStone::MouseButton_Left, (int)displayTouches[0].x, (int)displayTouches[0].y, OrthancStone::KeyboardModifiers_None, displayTouches); // one touch is equivalent to a mouse tracker without left button -> set the mouse coordinates to the first touch coordinates |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
143 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
144 |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
145 void WidgetViewport::TouchMove(const std::vector<Touch>& displayTouches) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
146 { |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
147 MouseMove((int)displayTouches[0].x, (int)displayTouches[0].y, displayTouches); // one touch is equivalent to a mouse tracker without left button -> set the mouse coordinates to the first touch coordinates |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
148 } |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
149 |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
150 void WidgetViewport::TouchEnd(const std::vector<Touch>& displayTouches) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
151 { |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
152 // note: TouchEnd is not triggered when a single touch gesture ends (it is only triggered when |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
153 // going from 2 touches to 1 touch, ...) |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
154 MouseUp(); |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
155 } |
0 | 156 |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
157 void WidgetViewport::MouseDown(OrthancStone::MouseButton button, |
0 | 158 int x, |
159 int y, | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
160 OrthancStone::KeyboardModifiers modifiers, |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
161 const std::vector<Touch>& displayTouches |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
162 ) |
0 | 163 { |
164 lastMouseX_ = x; | |
165 lastMouseY_ = y; | |
166 | |
167 if (centralWidget_.get() != NULL) | |
168 { | |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
169 mouseTracker_.reset(centralWidget_->CreateMouseTracker(button, x, y, modifiers, displayTouches)); |
0 | 170 } |
171 else | |
172 { | |
173 mouseTracker_.reset(NULL); | |
174 } | |
175 | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
176 NotifyContentChanged(); |
0 | 177 } |
178 | |
179 | |
180 void WidgetViewport::MouseUp() | |
181 { | |
182 if (mouseTracker_.get() != NULL) | |
183 { | |
184 mouseTracker_->MouseUp(); | |
185 mouseTracker_.reset(NULL); | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
186 NotifyContentChanged(); |
0 | 187 } |
188 } | |
189 | |
190 | |
191 void WidgetViewport::MouseMove(int x, | |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
192 int y, |
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
193 const std::vector<Touch>& displayTouches) |
0 | 194 { |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
195 if (centralWidget_.get() == NULL) |
0 | 196 { |
197 return; | |
198 } | |
199 | |
200 lastMouseX_ = x; | |
201 lastMouseY_ = y; | |
202 | |
54
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
203 bool repaint = false; |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
204 |
0 | 205 if (mouseTracker_.get() != NULL) |
206 { | |
457
3b4df9925db6
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents:
439
diff
changeset
|
207 mouseTracker_->MouseMove(x, y, displayTouches); |
54
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
208 repaint = true; |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
209 } |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
210 else |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
211 { |
55 | 212 repaint = centralWidget_->HasRenderMouseOver(); |
0 | 213 } |
214 | |
54
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
215 if (repaint) |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
216 { |
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
217 // The scene must be repainted, notify the observers |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
218 NotifyContentChanged(); |
54
01aa453d4d5b
IWidget::HasRenderMouseOver
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
53
diff
changeset
|
219 } |
0 | 220 } |
221 | |
222 | |
223 void WidgetViewport::MouseEnter() | |
224 { | |
225 isMouseOver_ = true; | |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
226 NotifyContentChanged(); |
0 | 227 } |
228 | |
229 | |
230 void WidgetViewport::MouseLeave() | |
231 { | |
232 isMouseOver_ = false; | |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
233 |
61
ca644004d2ee
MAJOR - removal of Start/Stop and observers in IWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
55
diff
changeset
|
234 if (mouseTracker_.get() != NULL) |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
235 { |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
236 mouseTracker_->MouseUp(); |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
237 mouseTracker_.reset(NULL); |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
238 } |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
239 |
385
6cc3ce74dc05
using message broker in widgets
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
369
diff
changeset
|
240 NotifyContentChanged(); |
0 | 241 } |
242 | |
243 | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
244 void WidgetViewport::MouseWheel(OrthancStone::MouseWheelDirection direction, |
0 | 245 int x, |
246 int y, | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
247 OrthancStone::KeyboardModifiers modifiers) |
0 | 248 { |
249 if (centralWidget_.get() != NULL && | |
250 mouseTracker_.get() == NULL) | |
251 { | |
252 centralWidget_->MouseWheel(direction, x, y, modifiers); | |
253 } | |
254 } | |
255 | |
256 | |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
257 void WidgetViewport::KeyPressed(OrthancStone::KeyboardKeys key, |
327 | 258 char keyChar, |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
561
diff
changeset
|
259 OrthancStone::KeyboardModifiers modifiers) |
0 | 260 { |
261 if (centralWidget_.get() != NULL && | |
262 mouseTracker_.get() == NULL) | |
263 { | |
327 | 264 centralWidget_->KeyPressed(key, keyChar, modifiers); |
0 | 265 } |
266 } | |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
267 |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
268 |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
269 bool WidgetViewport::HasAnimation() |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
270 { |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
271 if (centralWidget_.get() != NULL) |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
272 { |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
273 return centralWidget_->HasAnimation(); |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
274 } |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
275 else |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
276 { |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
277 return false; |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
278 } |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
279 } |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
280 |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
281 |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
282 void WidgetViewport::DoAnimation() |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
283 { |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
284 if (centralWidget_.get() != NULL) |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
285 { |
386
e33659decec5
renamed UpdateContent() as DoAnimation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
385
diff
changeset
|
286 centralWidget_->DoAnimation(); |
46
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
287 } |
766d31dc5716
removing threads for wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
288 } |
0 | 289 } |