diff options
Diffstat (limited to 'backends/platform/maemo')
-rw-r--r-- | backends/platform/maemo/debian/changelog | 12 | ||||
-rw-r--r-- | backends/platform/maemo/debian/control | 4 | ||||
-rwxr-xr-x | backends/platform/maemo/debian/rules | 2 | ||||
-rw-r--r-- | backends/platform/maemo/maemo-common.h | 19 | ||||
-rw-r--r-- | backends/platform/maemo/maemo.cpp | 122 | ||||
-rw-r--r-- | backends/platform/maemo/maemo.h | 14 |
6 files changed, 155 insertions, 18 deletions
diff --git a/backends/platform/maemo/debian/changelog b/backends/platform/maemo/debian/changelog index d3e0287186..8a9d8ee3c3 100644 --- a/backends/platform/maemo/debian/changelog +++ b/backends/platform/maemo/debian/changelog @@ -1,8 +1,14 @@ -scummvm (1.4.0~git) unstable; urgency=low +scummvm (1.5.0~git) unstable; urgency=low - * development snapshot + * Development snapshot - -- Tarek Soliman <tsoliman@scummvm.org> Wed, 05 Oct 2011 19:01:25 -0500 + -- Tarek Soliman <tsoliman@scummvm.org> Tue, 15 Nov 2011 14:56:57 -0600 + +scummvm (1.4.0) unstable; urgency=low + + * 1.4.0 release + + -- Tarek Soliman <tsoliman@scummvm.org> Thu, 03 Nov 2011 13:54:04 -0500 scummvm (1.2.1~pre) unstable; urgency=low diff --git a/backends/platform/maemo/debian/control b/backends/platform/maemo/debian/control index a1f0d95002..6e1dfe2fd4 100644 --- a/backends/platform/maemo/debian/control +++ b/backends/platform/maemo/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, Standards-Version: 3.6.1.1 Package: scummvm Depends: ${shlibs:Depends} -Architecture: i386 armel +Architecture: armel Section: user/games Description: interpreter that will play graphic adventure games written for LucasArts' SCUMM virtual machine, Sierra's AGI adventures, @@ -17,6 +17,8 @@ Description: interpreter that will play graphic adventure games Coktel Vision's Gobliiins, Wyrmkeep's Inherit the Earth, Westwood's Legend of Kyrandia, and various others. This package does not contain any actual games. +XSBC-Bugtracker: https://sourceforge.net/tracker/?atid=418820&group_id=37116&func=browse +XB-Maemo-Display-Name: ScummVM XBS-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAC/VBMVEUICwcH CQUKDAgLDQoMDwsOEAwREAUPEQ0QEg8PFQoRExAUEwoVFAwPGAcTFBIRFg0W diff --git a/backends/platform/maemo/debian/rules b/backends/platform/maemo/debian/rules index 7613df25b4..64add08de8 100755 --- a/backends/platform/maemo/debian/rules +++ b/backends/platform/maemo/debian/rules @@ -47,7 +47,7 @@ install: build install -m0644 gui/themes/scummclassic.zip gui/themes/scummmodern.zip debian/scummvm/opt/scummvm/share install -m0644 backends/vkeybd/packs/vkeybd_default.zip debian/scummvm/opt/scummvm/share # for optified version we can also add engine datafiles - install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/m4.dat dists/engine-data/mads.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share + install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share install -m0644 -d debian/scummvm/usr/share/doc/scummvm install -m0644 NEWS README COPYRIGHT debian/scummvm/usr/share/doc/scummvm diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h index f33aa24278..0442b9c0ae 100644 --- a/backends/platform/maemo/maemo-common.h +++ b/backends/platform/maemo/maemo-common.h @@ -28,9 +28,10 @@ namespace Maemo { enum ModelType { - kModelTypeN800 = 1, - kModelTypeN810 = 2, - kModelTypeN900 = 4, + kModelType770 = 1 << 0, + kModelTypeN800 = 1 << 1, + kModelTypeN810 = 1 << 2, + kModelTypeN900 = 1 << 3, kModelTypeInvalid = 0 }; @@ -38,15 +39,13 @@ struct Model { const char *hwId; ModelType modelType; const char *hwAlias; - bool hwKeyboard; + bool hasHwKeyboard; + bool hasMenuKey; }; -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} +enum CustomEventType { + kEventClickMode = 1, + kEventInvalid = 0 }; } // namespace Maemo diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index 3571039e62..e296d4787c 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -29,7 +29,11 @@ #include "backends/platform/maemo/maemo.h" #include "backends/events/maemosdl/maemosdl-events.h" +#include "backends/graphics/maemosdl/maemosdl-graphics.h" +#include "backends/keymapper/keymapper.h" +#include "backends/keymapper/keymapper-defaults.h" #include "common/textconsole.h" +#include "common/translation.h" #include <SDL/SDL_syswm.h> @@ -42,17 +46,70 @@ OSystem_SDL_Maemo::OSystem_SDL_Maemo() OSystem_POSIX() { } +OSystem_SDL_Maemo::~OSystem_SDL_Maemo() { + delete _eventObserver; +#ifdef ENABLE_KEYMAPPER + delete _keymapperDefaultBindings; +#endif +} + +#ifdef ENABLE_KEYMAPPER +static void registerDefaultKeyBindings(Common::KeymapperDefaultBindings *_keymapperDefaultBindings, Model _model) { + _keymapperDefaultBindings->setDefaultBinding("gui", "REM", "HOME"); + _keymapperDefaultBindings->setDefaultBinding("global", "REM", "HOME"); + + if (_model.hasMenuKey && _model.hasHwKeyboard) { + _keymapperDefaultBindings->setDefaultBinding("gui", "FUL", "FULLSCREEN"); + _keymapperDefaultBindings->setDefaultBinding("global", "FUL", "FULLSCREEN"); + } + + if (_model.hasHwKeyboard) { + _keymapperDefaultBindings->setDefaultBinding("gui", "VIR", "C+ZOOMMINUS"); + _keymapperDefaultBindings->setDefaultBinding("global", "VIR", "C+ZOOMMINUS"); + } else { + _keymapperDefaultBindings->setDefaultBinding("gui", "VIR", "FULLSCREEN"); + _keymapperDefaultBindings->setDefaultBinding("global", "VIR", "FULLSCREEN"); + } + + if (_model.hasMenuKey ) + _keymapperDefaultBindings->setDefaultBinding("global", "MEN", "MENU"); + else + _keymapperDefaultBindings->setDefaultBinding("global", "MEN", "S+C+M"); + + _keymapperDefaultBindings->setDefaultBinding("gui", "CLO", "ESCAPE"); + + _keymapperDefaultBindings->setDefaultBinding("maemo", "RCL", "ZOOMPLUS"); + _keymapperDefaultBindings->setDefaultBinding("maemo", "CLK", "ZOOMMINUS"); +} +#endif + void OSystem_SDL_Maemo::initBackend() { // Create the events manager if (_eventSource == 0) _eventSource = new MaemoSdlEventSource(); + if (_graphicsManager == 0) + _graphicsManager = new MaemoSdlGraphicsManager(_eventSource); + + if (_eventObserver == 0) + _eventObserver = new MaemoSdlEventObserver((MaemoSdlEventSource *)_eventSource); + +#ifdef ENABLE_KEYMAPPER + if (_keymapperDefaultBindings == 0) + _keymapperDefaultBindings = new Common::KeymapperDefaultBindings(); +#endif + ConfMan.set("vkeybdpath", DATA_PATH); - _model = Model(detectModel()); + _model = detectModel(); + +#ifdef ENABLE_KEYMAPPER + registerDefaultKeyBindings(_keymapperDefaultBindings, _model); +#endif // Call parent implementation of this method OSystem_POSIX::initBackend(); + initObserver(); } void OSystem_SDL_Maemo::quit() { @@ -98,16 +155,77 @@ void OSystem_SDL_Maemo::setWindowCaption(const char *caption) { setXWindowName(cap.c_str()); } +static const Model models[] = { + {"SU-18", kModelType770, "770", false, true}, + {"RX-34", kModelTypeN800, "N800", false, true}, + {"RX-44", kModelTypeN810, "N810", true, true}, + {"RX-48", kModelTypeN810, "N810W", true, true}, + {"RX-51", kModelTypeN900, "N900", true, false}, + {0, kModelTypeInvalid, 0, true, true} +}; + const Maemo::Model OSystem_SDL_Maemo::detectModel() { Common::String deviceHwId = Common::String(getenv("SCUMMVM_MAEMO_DEVICE")); const Model *model; - for (model = models; model->hwId; model++) { + for (model = models; model->hwId; ++model) { if (deviceHwId.equals(model->hwId)) return *model; } return *model; } +void OSystem_SDL_Maemo::setupIcon() { + // no Maemo version needs setupIcon + // also N900 is hit by SDL_WM_SetIcon bug (window cannot receive input) + // http://bugzilla.libsdl.org/show_bug.cgi?id=586 +} + +static const Common::KeyTableEntry maemoKeys[] = { + // Function keys + {"MENU", Common::KEYCODE_F11, 0, "Menu", false}, + {"HOME", Common::KEYCODE_F12, 0, "Home", false}, + {"FULLSCREEN", Common::KEYCODE_F13, 0, "FullScreen", false}, + {"ZOOMPLUS", Common::KEYCODE_F14, 0, "Zoom+", false}, + {"ZOOMMINUS", Common::KEYCODE_F15, 0, "Zoom-", false}, + + {0, Common::KEYCODE_INVALID, 0, 0, false} +}; + +#ifdef ENABLE_KEYMAPPER +Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() { + return new Common::HardwareInputSet(true, maemoKeys); +} + +Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() { + using namespace Common; + Keymap *globalMap = new Keymap("maemo"); + + Action *act; + + act = new Action(globalMap, "CLKM", _("Click Mode")); + Event evt = Event(); + evt.type = EVENT_CUSTOM_BACKEND_ACTION; + evt.customType = Maemo::kEventClickMode; + act->addEvent(evt); + + act = new Action(globalMap, "LCLK", _("Left Click")); + act->addLeftClickEvent(); + + act = new Action(globalMap, "MCLK", _("Middle Click")); + act->addMiddleClickEvent(); + + act = new Action(globalMap, "RCLK", _("Right Click")); + act->addRightClickEvent(); + + return globalMap; +} +#endif + +void OSystem_SDL_Maemo::initObserver() { + assert(_eventManager); + _eventManager->getEventDispatcher()->registerObserver(_eventObserver, 10, false); +} + } //namespace Maemo #endif diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h index e42936ddf0..43bc262ade 100644 --- a/backends/platform/maemo/maemo.h +++ b/backends/platform/maemo/maemo.h @@ -29,24 +29,36 @@ #include "backends/platform/maemo/maemo-common.h" namespace Maemo { +class MaemoSdlEventObserver; class OSystem_SDL_Maemo : public OSystem_POSIX { public: OSystem_SDL_Maemo(); + ~OSystem_SDL_Maemo(); virtual void initBackend(); virtual void quit(); virtual void fatalError(); virtual void setWindowCaption(const char *caption); + virtual void setupIcon(); +#ifdef ENABLE_KEYMAPPER + virtual Common::HardwareInputSet *getHardwareInputSet(); + virtual Common::Keymap *getGlobalKeymap(); + virtual Common::KeymapperDefaultBindings *getKeymapperDefaultBindings() { return _keymapperDefaultBindings; } +#endif Model getModel() { return _model; } private: virtual void setXWindowName(const char *caption); + void initObserver(); const Model detectModel(); Model _model; - + MaemoSdlEventObserver *_eventObserver; +#ifdef ENABLE_KEYMAPPER + Common::KeymapperDefaultBindings *_keymapperDefaultBindings; +#endif }; } // namespace Maemo |