MAEMO: Add basic structs to Maemo namespace

This commit is contained in:
Tarek Soliman 2011-10-11 18:06:52 -05:00
parent a1fe57702a
commit 52fae5524c
3 changed files with 23 additions and 20 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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;
};