aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/x11
diff options
context:
space:
mode:
authorMax Horn2007-03-17 19:02:05 +0000
committerMax Horn2007-03-17 19:02:05 +0000
commited54ea9155961d8ca5d5fb3c7777fc57a29f2751 (patch)
tree467b926af11cd4129ba003d04ba01de044c7a6df /backends/platform/x11
parentf272d1957084098c5b53975ad3501074f6971af8 (diff)
downloadscummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.tar.gz
scummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.tar.bz2
scummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.zip
Moved Event/EventType/keyboard enum from common/system.h (part of class OSystem) to common/events.h (part of namespace Common). Porters may have to make minor changes to their backends to get them to compile again
svn-id: r26180
Diffstat (limited to 'backends/platform/x11')
-rw-r--r--backends/platform/x11/x11.cpp33
-rw-r--r--backends/platform/x11/x11.h2
2 files changed, 18 insertions, 17 deletions
diff --git a/backends/platform/x11/x11.cpp b/backends/platform/x11/x11.cpp
index 7be5a976a9..60c6939b2d 100644
--- a/backends/platform/x11/x11.cpp
+++ b/backends/platform/x11/x11.cpp
@@ -25,6 +25,7 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
+#include "common/events.h"
#include "common/system.h"
#include "common/util.h"
#include "base/main.h"
@@ -753,7 +754,7 @@ void OSystem_X11::delayMillis(uint msecs) {
usleep(msecs * 1000);
}
-bool OSystem_X11::pollEvent(Event &scumm_event) {
+bool OSystem_X11::pollEvent(Common::Event &scumm_event) {
/* First, handle timers */
uint32 current_msecs = getMillis();
@@ -812,11 +813,11 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
byte mode = 0;
if (event.xkey.state & 0x01)
- mode |= KBD_SHIFT;
+ mode |= Common::KBD_SHIFT;
if (event.xkey.state & 0x04)
- mode |= KBD_CTRL;
+ mode |= Common::KBD_CTRL;
if (event.xkey.state & 0x08)
- mode |= KBD_ALT;
+ mode |= Common::KBD_ALT;
switch (event.xkey.keycode) {
case 9: /* Escape on my PC */
@@ -852,7 +853,7 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
}
}
if (keycode != -1) {
- scumm_event.type = EVENT_KEYDOWN;
+ scumm_event.type = Common::EVENT_KEYDOWN;
scumm_event.kbd.keycode = keycode;
scumm_event.kbd.ascii = (ascii != -1 ? ascii : keycode);
scumm_event.kbd.flags = mode;
@@ -870,11 +871,11 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
byte mode = 0;
if (event.xkey.state & 0x01)
- mode |= KBD_SHIFT;
+ mode |= Common::KBD_SHIFT;
if (event.xkey.state & 0x04)
- mode |= KBD_CTRL;
+ mode |= Common::KBD_CTRL;
if (event.xkey.state & 0x08)
- mode |= KBD_ALT;
+ mode |= Common::KBD_ALT;
switch (event.xkey.keycode) {
case 132: /* 'Q' on the iPAQ */
_report_presses = 1;
@@ -894,7 +895,7 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
}
}
if (keycode != -1) {
- scumm_event.type = EVENT_KEYUP;
+ scumm_event.type = Common::EVENT_KEYUP;
scumm_event.kbd.keycode = keycode;
scumm_event.kbd.ascii = (ascii != -1 ? ascii : keycode);
scumm_event.kbd.flags = mode;
@@ -907,12 +908,12 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
if (_report_presses != 0) {
if (event.xbutton.button == 1) {
if (_fake_right_mouse == 0) {
- scumm_event.type = EVENT_LBUTTONDOWN;
+ scumm_event.type = Common::EVENT_LBUTTONDOWN;
} else {
- scumm_event.type = EVENT_RBUTTONDOWN;
+ scumm_event.type = Common::EVENT_RBUTTONDOWN;
}
} else if (event.xbutton.button == 3)
- scumm_event.type = EVENT_RBUTTONDOWN;
+ scumm_event.type = Common::EVENT_RBUTTONDOWN;
scumm_event.mouse.x = event.xbutton.x - _scumm_x;
scumm_event.mouse.y = event.xbutton.y - _scumm_y;
return true;
@@ -923,12 +924,12 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
if (_report_presses != 0) {
if (event.xbutton.button == 1) {
if (_fake_right_mouse == 0) {
- scumm_event.type = EVENT_LBUTTONUP;
+ scumm_event.type = Common::EVENT_LBUTTONUP;
} else {
- scumm_event.type = EVENT_RBUTTONUP;
+ scumm_event.type = Common::EVENT_RBUTTONUP;
}
} else if (event.xbutton.button == 3)
- scumm_event.type = EVENT_RBUTTONUP;
+ scumm_event.type = Common::EVENT_RBUTTONUP;
scumm_event.mouse.x = event.xbutton.x - _scumm_x;
scumm_event.mouse.y = event.xbutton.y - _scumm_y;
return true;
@@ -936,7 +937,7 @@ bool OSystem_X11::pollEvent(Event &scumm_event) {
break;
case MotionNotify:
- scumm_event.type = EVENT_MOUSEMOVE;
+ scumm_event.type = Common::EVENT_MOUSEMOVE;
scumm_event.mouse.x = event.xmotion.x - _scumm_x;
scumm_event.mouse.y = event.xmotion.y - _scumm_y;
set_mouse_pos(scumm_event.mouse.x, scumm_event.mouse.y);
diff --git a/backends/platform/x11/x11.h b/backends/platform/x11/x11.h
index ba29bc7eab..3a46a3f793 100644
--- a/backends/platform/x11/x11.h
+++ b/backends/platform/x11/x11.h
@@ -88,7 +88,7 @@ public:
// Get the next event.
// Returns true if an event was retrieved.
- bool pollEvent(Event &event);
+ bool pollEvent(Common::Event &event);
// Set function that generates samples
bool setSoundCallback(SoundProc proc, void *param);