From 086fe78af1b0d16d1902c8f9351e1dc7c103241b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 31 Oct 2010 17:10:45 +0000 Subject: WINCE: Enable use of forbidden symbols, cleanup I tried to untangle the header interdependencies a bit, but this is still quite a mess. This commit also fixes some warnings. svn-id: r53978 --- backends/platform/wince/CEActionsPocket.cpp | 14 ++++++++----- backends/platform/wince/CEActionsPocket.h | 8 +++++--- backends/platform/wince/CEActionsSmartphone.cpp | 6 +++++- backends/platform/wince/CEActionsSmartphone.h | 6 +++--- backends/platform/wince/CEDevice.cpp | 5 ++++- backends/platform/wince/CELauncherDialog.cpp | 4 +++- backends/platform/wince/CEgui/GUIElement.cpp | 5 +++++ backends/platform/wince/CEgui/GUIElement.h | 6 +++--- backends/platform/wince/CEgui/ItemSwitch.cpp | 1 + backends/platform/wince/CEgui/ItemSwitch.h | 1 + backends/platform/wince/CEgui/PanelKeyboard.cpp | 5 +++++ .../platform/wince/CEgui/SDL_ImageResource.cpp | 4 ++++ backends/platform/wince/CEgui/SDL_ImageResource.h | 2 +- backends/platform/wince/CEgui/Toolbar.h | 4 ---- backends/platform/wince/CEgui/ToolbarHandler.cpp | 5 +++++ backends/platform/wince/CEkeys/EventsBuffer.cpp | 5 +++++ backends/platform/wince/CEkeys/EventsBuffer.h | 2 -- backends/platform/wince/missing/missing.cpp | 2 ++ backends/platform/wince/wince-sdl.cpp | 24 +++++++++++++--------- 19 files changed, 75 insertions(+), 34 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 64abd0be3e..2005c86847 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -23,21 +23,25 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/platform/wince/wince-sdl.h" #include "CEActionsPocket.h" #include "EventsBuffer.h" #include "gui/message.h" -#include "scumm/scumm.h" #include "common/config-manager.h" #include "gui/KeysDialog.h" #include "common/translation.h" + #ifdef _WIN32_WCE #define KEY_ALL_SKIP 3457 #endif -const String pocketActionNames[] = { +const Common::String pocketActionNames[] = { _s("Pause"), _s("Save"), _s("Quit"), @@ -64,7 +68,7 @@ void CEActionsPocket::init() { } -String CEActionsPocket::actionName(GUI::ActionType action) { +Common::String CEActionsPocket::actionName(GUI::ActionType action) { return _(pocketActionNames[action]); } @@ -72,7 +76,7 @@ int CEActionsPocket::size() { return POCKET_ACTION_LAST; } -String CEActionsPocket::domain() { +Common::String CEActionsPocket::domain() { return ConfMan.kApplicationDomain; } @@ -114,7 +118,7 @@ void CEActionsPocket::initInstanceMain(OSystem *mainSystem) { } void CEActionsPocket::initInstanceGame() { - String gameid(ConfMan.get("gameid")); + Common::String gameid(ConfMan.get("gameid")); bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); bool is_sword1 = (gameid == "sword1"); bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h index 0fe29a9e86..0a15e25648 100644 --- a/backends/platform/wince/CEActionsPocket.h +++ b/backends/platform/wince/CEActionsPocket.h @@ -28,7 +28,7 @@ #include "common/scummsys.h" #include "common/system.h" -#include "wince-sdl.h" +#include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" @@ -58,11 +58,13 @@ enum pocketActionType { POCKET_ACTION_LAST }; +class OSystem_WINCE3; + class CEActionsPocket : public GUI::Actions { public: // Actions bool perform(GUI::ActionType action, bool pushed = true); - String actionName(GUI::ActionType action); + Common::String actionName(GUI::ActionType action); int size(); static void init(); @@ -70,7 +72,7 @@ class CEActionsPocket : public GUI::Actions { void initInstanceGame(); // Action domain - String domain(); + Common::String domain(); int version(); // Utility diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index af80bd2908..5c7feb4950 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -23,10 +23,14 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/platform/wince/wince-sdl.h" + #include "CEActionsSmartphone.h" #include "EventsBuffer.h" #include "gui/message.h" -#include "scumm/scumm.h" #include "common/config-manager.h" #include "gui/KeysDialog.h" diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h index 36797cd2c8..d7a6f535b6 100644 --- a/backends/platform/wince/CEActionsSmartphone.h +++ b/backends/platform/wince/CEActionsSmartphone.h @@ -28,7 +28,7 @@ #include "common/scummsys.h" #include "common/system.h" -#include "wince-sdl.h" +#include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" @@ -58,14 +58,14 @@ class CEActionsSmartphone : public GUI::Actions { public: // Actions bool perform(GUI::ActionType action, bool pushed = true); - String actionName(GUI::ActionType action); + Common::String actionName(GUI::ActionType action); int size(); static void init(); void initInstanceMain(OSystem *mainSystem); void initInstanceGame(); // Action domain - String domain(); + Common::String domain(); int version(); ~CEActionsSmartphone(); diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp index 98a8fb95f6..08acbbbfcd 100644 --- a/backends/platform/wince/CEDevice.cpp +++ b/backends/platform/wince/CEDevice.cpp @@ -23,11 +23,14 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "CEDevice.h" #include -#include "wince-sdl.h" +#include "backends/platform/wince/wince-sdl.h" static void (WINAPI* _SHIdleTimerReset)(void) = NULL; static HANDLE (WINAPI* _SetPowerRequirement)(PVOID,int,ULONG,PVOID,ULONG) = NULL; diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index 11e4900c2d..66a691f51b 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -23,8 +23,10 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL -#include "wince-sdl.h" +#include "backends/platform/wince/wince-sdl.h" #include "CELauncherDialog.h" diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp index 23e7843de1..26ec7d93d5 100644 --- a/backends/platform/wince/CEgui/GUIElement.cpp +++ b/backends/platform/wince/CEgui/GUIElement.cpp @@ -23,6 +23,11 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include + #include "Toolbar.h" #include "SDL_ImageResource.h" diff --git a/backends/platform/wince/CEgui/GUIElement.h b/backends/platform/wince/CEgui/GUIElement.h index 7e4572d377..b8ac3e1a66 100644 --- a/backends/platform/wince/CEgui/GUIElement.h +++ b/backends/platform/wince/CEgui/GUIElement.h @@ -29,12 +29,12 @@ #include "common/scummsys.h" #include "common/system.h" -#include "SDL.h" - -#include "SDL_ImageResource.h" +struct SDL_Surface; namespace CEGUI { + class SDL_ImageResource; + class GUIElement { public: bool setBackground(WORD backgroundReference); diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp index 8e0121f7c4..76ea5fbdff 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.cpp +++ b/backends/platform/wince/CEgui/ItemSwitch.cpp @@ -24,6 +24,7 @@ */ #include "ItemSwitch.h" +#include "SDL_ImageResource.h" namespace CEGUI { diff --git a/backends/platform/wince/CEgui/ItemSwitch.h b/backends/platform/wince/CEgui/ItemSwitch.h index 8d03ee77cb..f766612abb 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.h +++ b/backends/platform/wince/CEgui/ItemSwitch.h @@ -35,6 +35,7 @@ using GUI::Key; namespace CEGUI { + class SDL_ImageResource; class ItemSwitch : public PanelItem { public: diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp index 369a75cae1..1e59760e96 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp @@ -23,6 +23,11 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include + #include "PanelKeyboard.h" namespace CEGUI { diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp index ce6ebd6382..b6cfa0cb1f 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp +++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp @@ -23,6 +23,10 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "SDL.h" #include "SDL_ImageResource.h" namespace CEGUI { diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.h b/backends/platform/wince/CEgui/SDL_ImageResource.h index 454237dd15..269dfe49ea 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.h +++ b/backends/platform/wince/CEgui/SDL_ImageResource.h @@ -29,7 +29,7 @@ #include "common/scummsys.h" #include "common/system.h" -#include "SDL.h" +struct SDL_Surface; namespace CEGUI { class SDL_ImageResource { diff --git a/backends/platform/wince/CEgui/Toolbar.h b/backends/platform/wince/CEgui/Toolbar.h index 3c48e6188a..961aa15200 100644 --- a/backends/platform/wince/CEgui/Toolbar.h +++ b/backends/platform/wince/CEgui/Toolbar.h @@ -27,10 +27,6 @@ #define CEGUI_TOOLBAR_H #include "common/scummsys.h" -#include "common/system.h" - -//#include "common/map.h" -#include "common/str.h" #include "GUIElement.h" diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp index 3f93a4720d..310dd24bfb 100644 --- a/backends/platform/wince/CEgui/ToolbarHandler.cpp +++ b/backends/platform/wince/CEgui/ToolbarHandler.cpp @@ -23,6 +23,11 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include + #include "ToolbarHandler.h" namespace CEGUI { diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index f31a77570f..3cdcb44173 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -23,6 +23,11 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include + #include "EventsBuffer.h" namespace CEKEYS { diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h index 44e1c66e47..22590db03c 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.h +++ b/backends/platform/wince/CEkeys/EventsBuffer.h @@ -30,8 +30,6 @@ #include "common/system.h" #include "common/list.h" -#include - #include "gui/Key.h" namespace CEKEYS { diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp index 532f1d2e89..3233a04aa1 100644 --- a/backends/platform/wince/missing/missing.cpp +++ b/backends/platform/wince/missing/missing.cpp @@ -29,6 +29,8 @@ * by Vasyl Tsvirkunov */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include #include diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index ac9be5df48..3f64cb7d5d 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -23,6 +23,9 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "backends/platform/wince/wince-sdl.h" #include "common/config-manager.h" @@ -970,8 +973,9 @@ bool OSystem_WINCE3::getFeatureState(Feature f) { return false; case kFeatureVirtualKeyboard: return (_panelStateForced); + default: + return OSystem_SDL::getFeatureState(f); } - return OSystem_SDL::getFeatureState(f); } void OSystem_WINCE3::check_mappings() { @@ -2053,7 +2057,7 @@ void OSystem_WINCE3::undrawMouse() { if (SDL_LockSurface(_overlayVisible ? _overlayscreen : _screen) == -1) error("SDL_LockSurface failed: %s", SDL_GetError()); - int x, y; + int y; if (!_overlayVisible) { byte *dst, *bak = _mouseBackupOld; @@ -2242,14 +2246,15 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) { if (unfilter) { switch (key) { - case SDLK_ESCAPE: - return SDLK_BACKSPACE; - case SDLK_F8: - return SDLK_ASTERISK; - case SDLK_F9: - return SDLK_HASH; + case SDLK_ESCAPE: + return SDLK_BACKSPACE; + case SDLK_F8: + return SDLK_ASTERISK; + case SDLK_F9: + return SDLK_HASH; + default: + return key; } - return key; } if (key >= SDLK_KP0 && key <= SDLK_KP9) { @@ -2265,7 +2270,6 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) { bool OSystem_WINCE3::pollEvent(Common::Event &event) { SDL_Event ev; ev.type = SDL_NOEVENT; - byte b = 0; DWORD currentTime; bool keyEvent = false; int deltaX, deltaY; -- cgit v1.2.3