diff --git a/backends/events/symbiansdl/symbiansdl-events.cpp b/backends/events/symbiansdl/symbiansdl-events.cpp index c73424ec62a..2377fa49bf3 100644 --- a/backends/events/symbiansdl/symbiansdl-events.cpp +++ b/backends/events/symbiansdl/symbiansdl-events.cpp @@ -22,7 +22,7 @@ #include "common/scummsys.h" -#ifdef __SYMBIAN32__ +#if defined(__SYMBIAN32__) && defined(GUI_ENABLE_KEYSDIALOG) #include "backends/events/symbiansdl/symbiansdl-events.h" #include "backends/platform/symbian/src/SymbianActions.h" diff --git a/backends/events/symbiansdl/symbiansdl-events.h b/backends/events/symbiansdl/symbiansdl-events.h index 9b107dc0f46..d5276bc194e 100644 --- a/backends/events/symbiansdl/symbiansdl-events.h +++ b/backends/events/symbiansdl/symbiansdl-events.h @@ -25,6 +25,8 @@ #include "backends/events/sdl/legacy-sdl-events.h" +#ifdef GUI_ENABLE_KEYSDIALOG + #define TOTAL_ZONES 3 /** @@ -55,3 +57,5 @@ protected: }; #endif + +#endif diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp index 0810b382d20..3f5eab2b978 100644 --- a/backends/platform/symbian/src/SymbianActions.cpp +++ b/backends/platform/symbian/src/SymbianActions.cpp @@ -22,6 +22,8 @@ #include "backends/platform/symbian/src/SymbianActions.h" +#ifdef GUI_ENABLE_KEYSDIALOG + #include "gui/message.h" #include "scumm/scumm.h" #include "common/config-manager.h" @@ -257,3 +259,5 @@ bool SymbianActions::perform(ActionType /*action*/, bool /*pushed*/) { } } // namespace GUI + +#endif diff --git a/backends/platform/symbian/src/SymbianActions.h b/backends/platform/symbian/src/SymbianActions.h index fc68091c74a..bcc8448366c 100644 --- a/backends/platform/symbian/src/SymbianActions.h +++ b/backends/platform/symbian/src/SymbianActions.h @@ -24,6 +24,9 @@ #define SYMBIANACTIONS_H #include "common/scummsys.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + #include "common/system.h" #include "gui/Key.h" #include "gui/Actions.h" @@ -78,3 +81,5 @@ private: } // namespace GUI #endif + +#endif diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 59b2922f3ef..ee118584772 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -27,7 +27,6 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_fopen #include "backends/platform/symbian/src/SymbianOS.h" -#include "backends/platform/symbian/src/SymbianActions.h" #include "common/config-manager.h" #include "common/scummsys.h" #include "common/translation.h" @@ -36,9 +35,13 @@ #include "backends/fs/symbian/symbian-fs-factory.h" #include "backends/saves/default/default-saves.h" -#include "backends/events/symbiansdl/symbiansdl-events.h" #include "backends/mixer/symbiansdl/symbiansdl-mixer.h" +#ifdef GUI_ENABLE_KEYSDIALOG +#include "backends/platform/symbian/src/SymbianActions.h" +#include "backends/events/symbiansdl/symbiansdl-events.h" +#endif + #define DEFAULT_CONFIG_FILE "scummvm.ini" #define DEFAULT_SAVE_PATH "Savegames" @@ -99,11 +102,14 @@ void OSystem_SDL_Symbian::initBackend() { ConfMan.setBool("fullscreen", true); ConfMan.flushToDisk(); +#ifdef GUI_ENABLE_KEYSDIALOG GUI::Actions::init(); // Creates the backend managers if (_eventSource == 0) _eventSource = new SymbianSdlEventSource(); +#endif + if (_mixerManager == 0) { _mixerManager = new SymbianSdlMixerManager(); @@ -114,11 +120,13 @@ void OSystem_SDL_Symbian::initBackend() { // Call parent implementation of this method OSystem_SDL::initBackend(); +#ifdef GUI_ENABLE_KEYSDIALOG // Initialize global key mapping for Smartphones GUI::Actions* actions = GUI::Actions::Instance(); actions->initInstanceMain(this); actions->loadMapping(); +#endif } void OSystem_SDL_Symbian::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { @@ -135,6 +143,7 @@ void OSystem_SDL_Symbian::quitWithErrorMsg(const char * /*aMsg*/) { g_system->quit(); } +#ifdef GUI_ENABLE_KEYSDIALOG void OSystem_SDL_Symbian::quit() { delete GUI_Actions::Instance(); @@ -158,6 +167,7 @@ void OSystem_SDL_Symbian::checkMappings() { GUI::Actions::Instance()->initInstanceGame(); } +#endif Common::String OSystem_SDL_Symbian::getDefaultConfigFileName() { char configFile[MAXPATHLEN]; @@ -167,7 +177,11 @@ Common::String OSystem_SDL_Symbian::getDefaultConfigFileName() { } bool OSystem_SDL_Symbian::hasFeature(Feature f) { - if (f == kFeatureJoystickDeadzone || f == kFeatureFullscreenMode) +#ifdef GUI_ENABLE_KEYSDIALOG + if (f == kFeatureJoystickDeadzone) + return false; +#endif + if (f == kFeatureFullscreenMode) return false; return OSystem_SDL::hasFeature(f); diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h index ad11433887c..51bfecfcdd3 100644 --- a/backends/platform/symbian/src/SymbianOS.h +++ b/backends/platform/symbian/src/SymbianOS.h @@ -34,9 +34,11 @@ public: // Override from OSystem_SDL virtual void init(); virtual void initBackend(); +#ifdef GUI_ENABLE_KEYSDIALOG virtual void quit(); virtual void engineInit(); virtual void engineDone(); +#endif virtual Common::String getDefaultConfigFileName(); virtual bool hasFeature(Feature f); @@ -50,10 +52,12 @@ public: void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); protected: +#ifdef GUI_ENABLE_KEYSDIALOG /** * Used to intialized special game mappings */ void checkMappings(); +#endif RFs* _RFs; }; diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index 1a93c9c7225..f4a739df413 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -84,6 +84,7 @@ namespace std #undef remove #endif +// TODO: Replace this with the keymapper #define GUI_ENABLE_KEYSDIALOG #define DISABLE_COMMAND_LINE diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index f434071aced..477c0bd20eb 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -234,9 +234,11 @@ void MainMenuDialog::load() { close(); } +#ifdef GUI_ENABLE_KEYSDIALOG enum { kKeysCmd = 'KEYS' }; +#endif namespace GUI { @@ -373,24 +375,23 @@ void ConfigDialog::apply() { OptionsDialog::apply(); } +#ifdef GUI_ENABLE_KEYSDIALOG void ConfigDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { case kKeysCmd: - -#ifdef GUI_ENABLE_KEYSDIALOG - // - // Create the sub dialog(s) - // - _keysDialog = new GUI::KeysDialog(); - _keysDialog->runModal(); - delete _keysDialog; - _keysDialog = NULL; -#endif + // + // Create the sub dialog(s) + // + _keysDialog = new GUI::KeysDialog(); + _keysDialog->runModal(); + delete _keysDialog; + _keysDialog = NULL; break; default: GUI::OptionsDialog::handleCommand (sender, cmd, data); } } +#endif ExtraGuiOptionsWidget::ExtraGuiOptionsWidget(GuiObject *containerBoss, const Common::String &name, const Common::String &domain, const ExtraGuiOptions &options) : OptionsContainerWidget(containerBoss, name, dialogLayout(domain), false, domain), diff --git a/engines/dialogs.h b/engines/dialogs.h index 620812beea6..def91ba8917 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -85,8 +85,6 @@ public: ConfigDialog(); ~ConfigDialog() override; - void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override; - // OptionsDialog API void build() override; void apply() override; @@ -95,6 +93,10 @@ private: OptionsContainerWidget *_engineOptions; #ifdef GUI_ENABLE_KEYSDIALOG +public: + void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override; + +private: Dialog *_keysDialog; #endif }; diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 14bf29e1f28..c5d85f04bf7 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -48,10 +48,6 @@ #include "scumm/help.h" #endif -#ifdef GUI_ENABLE_KEYSDIALOG -#include "gui/KeysDialog.h" -#endif - using Graphics::kTextAlignCenter; using Graphics::kTextAlignLeft; using GUI::WIDGET_ENABLED; diff --git a/gui/Actions.cpp b/gui/Actions.cpp index 0c4aa6ba752..4ea2940ecd5 100644 --- a/gui/Actions.cpp +++ b/gui/Actions.cpp @@ -21,6 +21,9 @@ */ #include "gui/Actions.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + #include "gui/message.h" #include "common/config-manager.h" @@ -28,6 +31,8 @@ #include "backends/platform/symbian/src/SymbianActions.h" #endif +#warning The actions system is deprecated. Please use the keymapper instead. + namespace GUI { Actions* Actions::Instance() { @@ -150,3 +155,5 @@ Actions *Actions::_instance = NULL; } // namespace GUI + +#endif diff --git a/gui/Actions.h b/gui/Actions.h index ac7bd39093f..967f7c4a280 100644 --- a/gui/Actions.h +++ b/gui/Actions.h @@ -24,6 +24,9 @@ #define GUI_ACTIONS_H #include "common/scummsys.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + #include "common/system.h" #include "gui/Key.h" @@ -82,4 +85,7 @@ protected: } // namespace GUI typedef GUI::Actions GUI_Actions; + +#endif + #endif diff --git a/gui/Key.cpp b/gui/Key.cpp index cec48ffb65b..80baeca3c7e 100644 --- a/gui/Key.cpp +++ b/gui/Key.cpp @@ -22,6 +22,10 @@ #include "gui/Key.h" +#ifdef GUI_ENABLE_KEYSDIALOG + +#warning The actions system is deprecated. Please use the keymapper instead. + namespace GUI { Key::Key() : @@ -65,3 +69,5 @@ int Key::flags() { } } // namespace GUI + +#endif diff --git a/gui/Key.h b/gui/Key.h index 8bbbc4fdaa0..6052a6f8929 100644 --- a/gui/Key.h +++ b/gui/Key.h @@ -24,6 +24,9 @@ #define GUI_KEY_H #include "common/scummsys.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + #include "common/system.h" namespace GUI { @@ -56,3 +59,5 @@ private: } // namespace GUI #endif + +#endif diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp index 22d8cb42a8a..d11b94ae430 100644 --- a/gui/KeysDialog.cpp +++ b/gui/KeysDialog.cpp @@ -21,6 +21,11 @@ */ #include "gui/KeysDialog.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + +#warning The actions system is deprecated. Please use the keymapper instead. + #include "gui/Actions.h" #include "common/translation.h" #include @@ -146,3 +151,5 @@ void KeysDialog::handleKeyUp(Common::KeyState state) { } } // namespace GUI + +#endif diff --git a/gui/KeysDialog.h b/gui/KeysDialog.h index de60450db43..f9b8063242c 100644 --- a/gui/KeysDialog.h +++ b/gui/KeysDialog.h @@ -23,6 +23,10 @@ #ifndef KEYSDIALOG_H #define KEYSDIALOG_H +#include "common/scummsys.h" + +#ifdef GUI_ENABLE_KEYSDIALOG + #include "gui/gui-manager.h" #include "gui/dialog.h" #include "gui/widgets/list.h" @@ -50,3 +54,5 @@ protected: } // namespace GUI #endif + +#endif