[Scummvm-cvs-logs] scummvm master -> 174b8d6807b2dfb405682e95d600b85d4e879101
tsoliman
tarek at bashasoliman.com
Wed Oct 12 03:19:12 CEST 2011
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
42ccfbfdde MAEMO: Add detection for specific hardware model
a1fe57702a MAEMO: added hardware alias to the hardware detection table
52fae5524c MAEMO: Add basic structs to Maemo namespace
b56e9e2ef1 MAEMO: Migrate OSystem_SDL_Maemo to Maemo namespace
4ee07c848e MAEMO: Migrate MaemoSdlEventSource to Maemo namespace
174b8d6807 MAEMO: Add initial N800 support with Fullscreen key mapped to Virtual Keyboard
Commit: 42ccfbfdde548e6c96cbff8238c976cc12853712
https://github.com/scummvm/scummvm/commit/42ccfbfdde548e6c96cbff8238c976cc12853712
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T17:54:16-07:00
Commit Message:
MAEMO: Add detection for specific hardware model
Features detected right now are just the hardware keyboard
Changed paths:
A backends/platform/maemo/maemo-common.h
backends/platform/maemo/maemo.cpp
backends/platform/maemo/maemo.h
diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h
new file mode 100644
index 0000000..be256ad
--- /dev/null
+++ b/backends/platform/maemo/maemo-common.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#if defined(MAEMO)
+
+#ifndef PLATFORM_SDL_MAEMO_COMMON_H
+#define PLATFORM_SDL_MAEMO_COMMON_H
+
+enum MaemoModelType {
+ kMaemoModelTypeN800 = 1,
+ kMaemoModelTypeN810 = 2,
+ kMaemoModelTypeN900 = 4,
+ kMaemoModelTypeInvalid = 0
+};
+
+struct MaemoModel {
+ const char *hwId;
+ MaemoModelType modelType;
+ bool hwKeyboard;
+};
+
+static const MaemoModel maemoModels[] = {
+// N800
+ {"RX-34", kMaemoModelTypeN800, false},
+// N810
+ {"RX-44", kMaemoModelTypeN810, true},
+// N810W
+ {"RX-48", kMaemoModelTypeN810, true},
+// N900
+ {"RX-51", kMaemoModelTypeN900, true},
+ {0, kMaemoModelTypeInvalid, true}
+};
+
+
+#endif // ifndef PLATFORM_SDL_MAEMO_COMMON_H
+
+#endif // if defined(MAEMO)
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index 1fb7ad0..da5b619 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -22,6 +22,8 @@
#if defined(MAEMO)
+#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
+
#include "common/scummsys.h"
#include "common/config-manager.h"
@@ -45,6 +47,8 @@ void OSystem_SDL_Maemo::initBackend() {
ConfMan.set("vkeybdpath", DATA_PATH);
+ _maemoModel = MaemoModel(detectMaemoModel());
+
// Call parent implementation of this method
OSystem_POSIX::initBackend();
}
@@ -92,6 +96,15 @@ void OSystem_SDL_Maemo::setWindowCaption(const char *caption) {
setXWindowName(cap.c_str());
}
+const MaemoModel OSystem_SDL_Maemo::detectMaemoModel() {
+ Common::String deviceHwId = Common::String(getenv("SCUMMVM_MAEMO_DEVICE"));
+ const MaemoModel *model;
+ for (model = maemoModels; model->hwId; model++) {
+ if (deviceHwId.equals(model->hwId))
+ return *model;
+ }
+ return *model;
+}
#endif
diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h
index a7f2ec3..e177000 100644
--- a/backends/platform/maemo/maemo.h
+++ b/backends/platform/maemo/maemo.h
@@ -26,6 +26,8 @@
#define PLATFORM_SDL_MAEMO_H
#include "backends/platform/sdl/posix/posix.h"
+#include "backends/platform/maemo/maemo-common.h"
+
class OSystem_SDL_Maemo : public OSystem_POSIX {
public:
@@ -36,10 +38,16 @@ public:
virtual void fatalError();
virtual void setWindowCaption(const char *caption);
+ MaemoModel getMaemoModel() { return _maemoModel; }
+
private:
virtual void setXWindowName(const char *caption);
+ const MaemoModel detectMaemoModel();
+ MaemoModel _maemoModel;
+
};
-#endif
-#endif
+#endif // ifndef PLATFORM_SDL_MAEMO_H
+
+#endif // if defined(MAEMO)
Commit: a1fe57702ac394903df3bb9be331b87e28e38a73
https://github.com/scummvm/scummvm/commit/a1fe57702ac394903df3bb9be331b87e28e38a73
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T17:54:16-07:00
Commit Message:
MAEMO: added hardware alias to the hardware detection table
Changed paths:
backends/platform/maemo/maemo-common.h
diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h
index be256ad..6da38d4 100644
--- a/backends/platform/maemo/maemo-common.h
+++ b/backends/platform/maemo/maemo-common.h
@@ -35,19 +35,16 @@ enum MaemoModelType {
struct MaemoModel {
const char *hwId;
MaemoModelType modelType;
+ const char *hwAlias;
bool hwKeyboard;
};
static const MaemoModel maemoModels[] = {
-// N800
- {"RX-34", kMaemoModelTypeN800, false},
-// N810
- {"RX-44", kMaemoModelTypeN810, true},
-// N810W
- {"RX-48", kMaemoModelTypeN810, true},
-// N900
- {"RX-51", kMaemoModelTypeN900, true},
- {0, kMaemoModelTypeInvalid, true}
+ {"RX-34", kMaemoModelTypeN800, "N800", false},
+ {"RX-44", kMaemoModelTypeN810, "N810", true},
+ {"RX-48", kMaemoModelTypeN810, "N810W", true},
+ {"RX-51", kMaemoModelTypeN900, "N900", true},
+ {0, kMaemoModelTypeInvalid, 0, true}
};
Commit: 52fae5524c39044762b906ca938b99650d624491
https://github.com/scummvm/scummvm/commit/52fae5524c39044762b906ca938b99650d624491
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T17:54:16-07:00
Commit Message:
MAEMO: Add basic structs to Maemo namespace
Changed paths:
backends/platform/maemo/maemo-common.h
backends/platform/maemo/maemo.cpp
backends/platform/maemo/maemo.h
diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h
index 6da38d4..f33aa24 100644
--- a/backends/platform/maemo/maemo-common.h
+++ b/backends/platform/maemo/maemo-common.h
@@ -25,28 +25,31 @@
#ifndef PLATFORM_SDL_MAEMO_COMMON_H
#define PLATFORM_SDL_MAEMO_COMMON_H
-enum MaemoModelType {
- kMaemoModelTypeN800 = 1,
- kMaemoModelTypeN810 = 2,
- kMaemoModelTypeN900 = 4,
- kMaemoModelTypeInvalid = 0
+namespace Maemo {
+
+enum ModelType {
+ kModelTypeN800 = 1,
+ kModelTypeN810 = 2,
+ kModelTypeN900 = 4,
+ kModelTypeInvalid = 0
};
-struct MaemoModel {
+struct Model {
const char *hwId;
- MaemoModelType modelType;
+ ModelType modelType;
const char *hwAlias;
bool hwKeyboard;
};
-static const MaemoModel maemoModels[] = {
- {"RX-34", kMaemoModelTypeN800, "N800", false},
- {"RX-44", kMaemoModelTypeN810, "N810", true},
- {"RX-48", kMaemoModelTypeN810, "N810W", true},
- {"RX-51", kMaemoModelTypeN900, "N900", true},
- {0, kMaemoModelTypeInvalid, 0, true}
+static const Model models[] = {
+ {"RX-34", kModelTypeN800, "N800", false},
+ {"RX-44", kModelTypeN810, "N810", true},
+ {"RX-48", kModelTypeN810, "N810W", true},
+ {"RX-51", kModelTypeN900, "N900", true},
+ {0, kModelTypeInvalid, 0, true}
};
+} // namespace Maemo
#endif // ifndef PLATFORM_SDL_MAEMO_COMMON_H
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index da5b619..4f05f5c 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -47,7 +47,7 @@ void OSystem_SDL_Maemo::initBackend() {
ConfMan.set("vkeybdpath", DATA_PATH);
- _maemoModel = MaemoModel(detectMaemoModel());
+ _model = Maemo::Model(detectModel());
// Call parent implementation of this method
OSystem_POSIX::initBackend();
@@ -96,10 +96,10 @@ void OSystem_SDL_Maemo::setWindowCaption(const char *caption) {
setXWindowName(cap.c_str());
}
-const MaemoModel OSystem_SDL_Maemo::detectMaemoModel() {
+const Maemo::Model OSystem_SDL_Maemo::detectModel() {
Common::String deviceHwId = Common::String(getenv("SCUMMVM_MAEMO_DEVICE"));
- const MaemoModel *model;
- for (model = maemoModels; model->hwId; model++) {
+ const Maemo::Model *model;
+ for (model = Maemo::models; model->hwId; model++) {
if (deviceHwId.equals(model->hwId))
return *model;
}
diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h
index e177000..c806396 100644
--- a/backends/platform/maemo/maemo.h
+++ b/backends/platform/maemo/maemo.h
@@ -38,13 +38,13 @@ public:
virtual void fatalError();
virtual void setWindowCaption(const char *caption);
- MaemoModel getMaemoModel() { return _maemoModel; }
+ Maemo::Model getModel() { return _model; }
private:
virtual void setXWindowName(const char *caption);
- const MaemoModel detectMaemoModel();
- MaemoModel _maemoModel;
+ const Maemo::Model detectModel();
+ Maemo::Model _model;
};
Commit: b56e9e2ef11e8eac17c02972a237bfd5e1d6674d
https://github.com/scummvm/scummvm/commit/b56e9e2ef11e8eac17c02972a237bfd5e1d6674d
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T17:54:16-07:00
Commit Message:
MAEMO: Migrate OSystem_SDL_Maemo to Maemo namespace
Changed paths:
backends/platform/maemo/maemo.cpp
backends/platform/maemo/maemo.h
backends/platform/maemo/main.cpp
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index 4f05f5c..3571039 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -35,6 +35,8 @@
#include <SDL/SDL_syswm.h>
#include <X11/Xutil.h>
+namespace Maemo {
+
OSystem_SDL_Maemo::OSystem_SDL_Maemo()
:
OSystem_POSIX() {
@@ -47,7 +49,7 @@ void OSystem_SDL_Maemo::initBackend() {
ConfMan.set("vkeybdpath", DATA_PATH);
- _model = Maemo::Model(detectModel());
+ _model = Model(detectModel());
// Call parent implementation of this method
OSystem_POSIX::initBackend();
@@ -98,13 +100,14 @@ void OSystem_SDL_Maemo::setWindowCaption(const char *caption) {
const Maemo::Model OSystem_SDL_Maemo::detectModel() {
Common::String deviceHwId = Common::String(getenv("SCUMMVM_MAEMO_DEVICE"));
- const Maemo::Model *model;
- for (model = Maemo::models; model->hwId; model++) {
+ const Model *model;
+ for (model = models; model->hwId; model++) {
if (deviceHwId.equals(model->hwId))
return *model;
}
return *model;
}
+} //namespace Maemo
#endif
diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h
index c806396..e42936d 100644
--- a/backends/platform/maemo/maemo.h
+++ b/backends/platform/maemo/maemo.h
@@ -28,6 +28,7 @@
#include "backends/platform/sdl/posix/posix.h"
#include "backends/platform/maemo/maemo-common.h"
+namespace Maemo {
class OSystem_SDL_Maemo : public OSystem_POSIX {
public:
@@ -38,16 +39,18 @@ public:
virtual void fatalError();
virtual void setWindowCaption(const char *caption);
- Maemo::Model getModel() { return _model; }
+ Model getModel() { return _model; }
private:
virtual void setXWindowName(const char *caption);
- const Maemo::Model detectModel();
- Maemo::Model _model;
+ const Model detectModel();
+ Model _model;
};
+} // namespace Maemo
+
#endif // ifndef PLATFORM_SDL_MAEMO_H
#endif // if defined(MAEMO)
diff --git a/backends/platform/maemo/main.cpp b/backends/platform/maemo/main.cpp
index 6b69cd8..7e8a316 100644
--- a/backends/platform/maemo/main.cpp
+++ b/backends/platform/maemo/main.cpp
@@ -31,10 +31,10 @@
#include <unistd.h>
int main(int argc, char* argv[]) {
- g_system = new OSystem_SDL_Maemo();
+ g_system = new Maemo::OSystem_SDL_Maemo();
assert(g_system);
- ((OSystem_SDL_Maemo *)g_system)->init();
+ ((Maemo::OSystem_SDL_Maemo *)g_system)->init();
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
int res = scummvm_main(argc, argv);
// Free OSystem
- delete (OSystem_SDL_Maemo *)g_system;
+ delete (Maemo::OSystem_SDL_Maemo *)g_system;
return res;
}
Commit: 4ee07c848e462e078a1d3fd2f033111d153411ea
https://github.com/scummvm/scummvm/commit/4ee07c848e462e078a1d3fd2f033111d153411ea
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T17:54:16-07:00
Commit Message:
MAEMO: Migrate MaemoSdlEventSource to Maemo namespace
Also add some comments to the #endifs
Changed paths:
backends/events/maemosdl/maemosdl-events.cpp
backends/events/maemosdl/maemosdl-events.h
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index e111bf5..95dc64f 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -27,6 +27,8 @@
#include "backends/events/maemosdl/maemosdl-events.h"
#include "common/translation.h"
+namespace Maemo {
+
MaemoSdlEventSource::MaemoSdlEventSource() : SdlEventSource(), _clickEnabled(true) {
}
@@ -120,4 +122,6 @@ bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even
return SdlEventSource::handleMouseButtonUp(ev, event);
}
-#endif
+} // namespace Maemo
+
+#endif // if defined(MAEMO)
diff --git a/backends/events/maemosdl/maemosdl-events.h b/backends/events/maemosdl/maemosdl-events.h
index 6b41b3c..a31d939 100644
--- a/backends/events/maemosdl/maemosdl-events.h
+++ b/backends/events/maemosdl/maemosdl-events.h
@@ -29,6 +29,8 @@
#include "backends/platform/sdl/sdl.h"
#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
+namespace Maemo {
+
/**
* SDL events manager for Maemo
*/
@@ -43,6 +45,8 @@ protected:
bool _clickEnabled;
};
-#endif
+} // namespace Maemo
+
+#endif // include guard
-#endif
+#endif // if defined(MAEMO)
Commit: 174b8d6807b2dfb405682e95d600b85d4e879101
https://github.com/scummvm/scummvm/commit/174b8d6807b2dfb405682e95d600b85d4e879101
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2011-10-11T18:05:52-07:00
Commit Message:
MAEMO: Add initial N800 support with Fullscreen key mapped to Virtual Keyboard
N800 doesn't have a CTRL key to activate the virtual keyboard with.
Fullscreen can still be enabled/disabled through the GUI and was the most
likely sacrifice as a hardware key.
Changed paths:
backends/events/maemosdl/maemosdl-events.cpp
backends/events/maemosdl/maemosdl-events.h
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index 95dc64f..32d5cfb 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -35,6 +35,9 @@ MaemoSdlEventSource::MaemoSdlEventSource() : SdlEventSource(), _clickEnabled(tru
bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
+ Model model = Model(((OSystem_SDL_Maemo *)g_system)->getModel());
+ debug(10, "Model: %s %u %s %s", model.hwId, model.modelType, model.hwAlias, model.hwKeyboard ? "true" : "false");
+
// List of special N810 keys:
// SDLK_F4 -> menu
// SDLK_F5 -> home
@@ -46,12 +49,23 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
case SDL_KEYDOWN:{
if (ev.key.keysym.sym == SDLK_F4) {
event.type = Common::EVENT_MAINMENU;
+ debug(9, "remapping to main menu");
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
- // handled in keyup
+ if (!model.hwKeyboard) {
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = Common::KEYCODE_F7;
+ event.kbd.ascii = Common::ASCII_F7;
+ event.kbd.flags = 0;
+ debug(9, "remapping to F7 down (virtual keyboard)");
+ return true;
+ } else {
+ // handled in keyup
+ }
} else if (ev.key.keysym.sym == SDLK_F7) {
event.type = Common::EVENT_RBUTTONDOWN;
processMouseEvent(event, _km.x, _km.y);
+ debug(9, "remapping to right click down");
return true;
} else if (ev.key.keysym.sym == SDLK_F8) {
if (ev.key.keysym.mod & KMOD_CTRL) {
@@ -59,6 +73,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.kbd.keycode = Common::KEYCODE_F7;
event.kbd.ascii = Common::ASCII_F7;
event.kbd.flags = 0;
+ debug(9, "remapping to F7 down (virtual keyboard)");
return true;
} else {
// handled in keyup
@@ -72,14 +87,25 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MAINMENU;
return true;
} else if (ev.key.keysym.sym == SDLK_F6) {
- bool currentState = ((OSystem_SDL *)g_system)->getGraphicsManager()->getFeatureState(OSystem::kFeatureFullscreenMode);
- g_system->beginGFXTransaction();
- ((OSystem_SDL *)g_system)->getGraphicsManager()->setFeatureState(OSystem::kFeatureFullscreenMode, !currentState);
- g_system->endGFXTransaction();
- return true;
+ if (!model.hwKeyboard) {
+ event.type = Common::EVENT_KEYUP;
+ event.kbd.keycode = Common::KEYCODE_F7;
+ event.kbd.ascii = Common::ASCII_F7;
+ event.kbd.flags = 0;
+ debug(9, "remapping to F7 down (virtual keyboard)");
+ return true;
+ } else {
+ bool currentState = ((OSystem_SDL *)g_system)->getGraphicsManager()->getFeatureState(OSystem::kFeatureFullscreenMode);
+ g_system->beginGFXTransaction();
+ ((OSystem_SDL *)g_system)->getGraphicsManager()->setFeatureState(OSystem::kFeatureFullscreenMode, !currentState);
+ g_system->endGFXTransaction();
+ debug(9, "remapping to full screen toggle");
+ return true;
+ }
} else if (ev.key.keysym.sym == SDLK_F7) {
event.type = Common::EVENT_RBUTTONUP;
processMouseEvent(event, _km.x, _km.y);
+ debug(9, "remapping to right click up");
return true;
} else if (ev.key.keysym.sym == SDLK_F8) {
if (ev.key.keysym.mod & KMOD_CTRL) {
@@ -87,11 +113,13 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
event.kbd.keycode = Common::KEYCODE_F7;
event.kbd.ascii = Common::ASCII_F7;
event.kbd.flags = 0;
+ debug(9, "remapping to F7 up (virtual keyboard)");
return true;
} else {
_clickEnabled = !_clickEnabled;
((SurfaceSdlGraphicsManager*) _graphicsManager)->displayMessageOnOSD(
- _clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
+ _clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
+ debug(9, "remapping to click toggle");
return true;
}
}
diff --git a/backends/events/maemosdl/maemosdl-events.h b/backends/events/maemosdl/maemosdl-events.h
index a31d939..5c06c4b 100644
--- a/backends/events/maemosdl/maemosdl-events.h
+++ b/backends/events/maemosdl/maemosdl-events.h
@@ -26,7 +26,7 @@
#define BACKEND_EVENTS_SDL_MAEMO_H
#include "backends/events/sdl/sdl-events.h"
-#include "backends/platform/sdl/sdl.h"
+#include "backends/platform/maemo/maemo.h"
#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
namespace Maemo {
More information about the Scummvm-git-logs
mailing list