aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/macwindowmanager.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-19 10:37:53 +0200
committerEugene Sandulenko2016-04-19 10:37:53 +0200
commitfd7bf64131a0f1ecc5f3b4039c481fff52eb6efa (patch)
tree092ffce1e890a20636a17eeb934f3bfea4d32f40 /engines/wage/macwindowmanager.cpp
parent609dd56b136db3e0bdfc7906bdc386403e4a1192 (diff)
downloadscummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.tar.gz
scummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.tar.bz2
scummvm-rg350-fd7bf64131a0f1ecc5f3b4039c481fff52eb6efa.zip
WAGE: Switched event processing to generic code
Diffstat (limited to 'engines/wage/macwindowmanager.cpp')
-rw-r--r--engines/wage/macwindowmanager.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/wage/macwindowmanager.cpp b/engines/wage/macwindowmanager.cpp
index 08c8a4df3a..1bf7b54190 100644
--- a/engines/wage/macwindowmanager.cpp
+++ b/engines/wage/macwindowmanager.cpp
@@ -45,8 +45,9 @@
*
*/
-#include "common/list.h"
#include "common/array.h"
+#include "common/events.h"
+#include "common/list.h"
#include "common/system.h"
#include "graphics/managed_surface.h"
@@ -115,16 +116,20 @@ void MacWindowManager::draw() {
_fullRefresh = false;
}
-bool MacWindowManager::mouseDown(int x, int y) {
+bool MacWindowManager::processEvent(Common::Event &event) {
+ if (event.type != Common::EVENT_MOUSEMOVE && event.type != Common::EVENT_LBUTTONDOWN &&
+ event.type != Common::EVENT_LBUTTONUP)
+ return false;
+
for (Common::List<MacWindow *>::const_iterator it = _windowStack.end(); it != _windowStack.begin();) {
it--;
MacWindow *w = *it;
- if (w->getDimensions().contains(x, y)) {
- setActive(w->getId());
- w->mouseDown(x, y);
+ if (w->getDimensions().contains(event.mouse.x, event.mouse.y)) {
+ if (event.type == Common::EVENT_LBUTTONDOWN || event.type == Common::EVENT_LBUTTONUP)
+ setActive(w->getId());
- return true;
+ return w->processEvent(event);
}
}