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
This commit is contained in:
Max Horn 2010-10-31 17:10:45 +00:00
parent ae829727da
commit 086fe78af1
20 changed files with 76 additions and 35 deletions

View file

@ -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 "CEActionsPocket.h"
#include "EventsBuffer.h" #include "EventsBuffer.h"
#include "gui/message.h" #include "gui/message.h"
#include "scumm/scumm.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#include "gui/KeysDialog.h" #include "gui/KeysDialog.h"
#include "common/translation.h" #include "common/translation.h"
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#define KEY_ALL_SKIP 3457 #define KEY_ALL_SKIP 3457
#endif #endif
const String pocketActionNames[] = { const Common::String pocketActionNames[] = {
_s("Pause"), _s("Pause"),
_s("Save"), _s("Save"),
_s("Quit"), _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]); return _(pocketActionNames[action]);
} }
@ -72,7 +76,7 @@ int CEActionsPocket::size() {
return POCKET_ACTION_LAST; return POCKET_ACTION_LAST;
} }
String CEActionsPocket::domain() { Common::String CEActionsPocket::domain() {
return ConfMan.kApplicationDomain; return ConfMan.kApplicationDomain;
} }
@ -114,7 +118,7 @@ void CEActionsPocket::initInstanceMain(OSystem *mainSystem) {
} }
void CEActionsPocket::initInstanceGame() { 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_simon = (strncmp(gameid.c_str(), "simon", 5) == 0);
bool is_sword1 = (gameid == "sword1"); bool is_sword1 = (gameid == "sword1");
bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0);

View file

@ -28,7 +28,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/system.h" #include "common/system.h"
#include "wince-sdl.h" #include "common/str.h"
#include "gui/Key.h" #include "gui/Key.h"
#include "gui/Actions.h" #include "gui/Actions.h"
@ -58,11 +58,13 @@ enum pocketActionType {
POCKET_ACTION_LAST POCKET_ACTION_LAST
}; };
class OSystem_WINCE3;
class CEActionsPocket : public GUI::Actions { class CEActionsPocket : public GUI::Actions {
public: public:
// Actions // Actions
bool perform(GUI::ActionType action, bool pushed = true); bool perform(GUI::ActionType action, bool pushed = true);
String actionName(GUI::ActionType action); Common::String actionName(GUI::ActionType action);
int size(); int size();
static void init(); static void init();
@ -70,7 +72,7 @@ class CEActionsPocket : public GUI::Actions {
void initInstanceGame(); void initInstanceGame();
// Action domain // Action domain
String domain(); Common::String domain();
int version(); int version();
// Utility // Utility

View file

@ -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 "CEActionsSmartphone.h"
#include "EventsBuffer.h" #include "EventsBuffer.h"
#include "gui/message.h" #include "gui/message.h"
#include "scumm/scumm.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#include "gui/KeysDialog.h" #include "gui/KeysDialog.h"

View file

@ -28,7 +28,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/system.h" #include "common/system.h"
#include "wince-sdl.h" #include "common/str.h"
#include "gui/Key.h" #include "gui/Key.h"
#include "gui/Actions.h" #include "gui/Actions.h"
@ -58,14 +58,14 @@ class CEActionsSmartphone : public GUI::Actions {
public: public:
// Actions // Actions
bool perform(GUI::ActionType action, bool pushed = true); bool perform(GUI::ActionType action, bool pushed = true);
String actionName(GUI::ActionType action); Common::String actionName(GUI::ActionType action);
int size(); int size();
static void init(); static void init();
void initInstanceMain(OSystem *mainSystem); void initInstanceMain(OSystem *mainSystem);
void initInstanceGame(); void initInstanceGame();
// Action domain // Action domain
String domain(); Common::String domain();
int version(); int version();
~CEActionsSmartphone(); ~CEActionsSmartphone();

View file

@ -23,11 +23,14 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "CEDevice.h" #include "CEDevice.h"
#include <SDL.h> #include <SDL.h>
#include "wince-sdl.h" #include "backends/platform/wince/wince-sdl.h"
static void (WINAPI* _SHIdleTimerReset)(void) = NULL; static void (WINAPI* _SHIdleTimerReset)(void) = NULL;
static HANDLE (WINAPI* _SetPowerRequirement)(PVOID,int,ULONG,PVOID,ULONG) = NULL; static HANDLE (WINAPI* _SetPowerRequirement)(PVOID,int,ULONG,PVOID,ULONG) = NULL;

View file

@ -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" #include "CELauncherDialog.h"

View file

@ -23,6 +23,11 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "Toolbar.h" #include "Toolbar.h"
#include "SDL_ImageResource.h" #include "SDL_ImageResource.h"

View file

@ -29,12 +29,12 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/system.h" #include "common/system.h"
#include "SDL.h" struct SDL_Surface;
#include "SDL_ImageResource.h"
namespace CEGUI { namespace CEGUI {
class SDL_ImageResource;
class GUIElement { class GUIElement {
public: public:
bool setBackground(WORD backgroundReference); bool setBackground(WORD backgroundReference);

View file

@ -24,6 +24,7 @@
*/ */
#include "ItemSwitch.h" #include "ItemSwitch.h"
#include "SDL_ImageResource.h"
namespace CEGUI { namespace CEGUI {

View file

@ -35,6 +35,7 @@
using GUI::Key; using GUI::Key;
namespace CEGUI { namespace CEGUI {
class SDL_ImageResource;
class ItemSwitch : public PanelItem { class ItemSwitch : public PanelItem {
public: public:

View file

@ -23,6 +23,11 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "PanelKeyboard.h" #include "PanelKeyboard.h"
namespace CEGUI { namespace CEGUI {

View file

@ -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" #include "SDL_ImageResource.h"
namespace CEGUI { namespace CEGUI {

View file

@ -29,7 +29,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/system.h" #include "common/system.h"
#include "SDL.h" struct SDL_Surface;
namespace CEGUI { namespace CEGUI {
class SDL_ImageResource { class SDL_ImageResource {

View file

@ -27,10 +27,6 @@
#define CEGUI_TOOLBAR_H #define CEGUI_TOOLBAR_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/system.h"
//#include "common/map.h"
#include "common/str.h"
#include "GUIElement.h" #include "GUIElement.h"

View file

@ -23,6 +23,11 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "ToolbarHandler.h" #include "ToolbarHandler.h"
namespace CEGUI { namespace CEGUI {

View file

@ -23,6 +23,11 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "EventsBuffer.h" #include "EventsBuffer.h"
namespace CEKEYS { namespace CEKEYS {

View file

@ -30,8 +30,6 @@
#include "common/system.h" #include "common/system.h"
#include "common/list.h" #include "common/list.h"
#include <SDL.h>
#include "gui/Key.h" #include "gui/Key.h"
namespace CEKEYS { namespace CEKEYS {

View file

@ -29,6 +29,8 @@
* by Vasyl Tsvirkunov * by Vasyl Tsvirkunov
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <tchar.h>

View file

@ -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 "backends/platform/wince/wince-sdl.h"
#include "common/config-manager.h" #include "common/config-manager.h"
@ -970,9 +973,10 @@ bool OSystem_WINCE3::getFeatureState(Feature f) {
return false; return false;
case kFeatureVirtualKeyboard: case kFeatureVirtualKeyboard:
return (_panelStateForced); return (_panelStateForced);
} default:
return OSystem_SDL::getFeatureState(f); return OSystem_SDL::getFeatureState(f);
} }
}
void OSystem_WINCE3::check_mappings() { void OSystem_WINCE3::check_mappings() {
CEActionsPocket *instance; CEActionsPocket *instance;
@ -2053,7 +2057,7 @@ void OSystem_WINCE3::undrawMouse() {
if (SDL_LockSurface(_overlayVisible ? _overlayscreen : _screen) == -1) if (SDL_LockSurface(_overlayVisible ? _overlayscreen : _screen) == -1)
error("SDL_LockSurface failed: %s", SDL_GetError()); error("SDL_LockSurface failed: %s", SDL_GetError());
int x, y; int y;
if (!_overlayVisible) { if (!_overlayVisible) {
byte *dst, *bak = _mouseBackupOld; byte *dst, *bak = _mouseBackupOld;
@ -2248,9 +2252,10 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) {
return SDLK_ASTERISK; return SDLK_ASTERISK;
case SDLK_F9: case SDLK_F9:
return SDLK_HASH; return SDLK_HASH;
} default:
return key; return key;
} }
}
if (key >= SDLK_KP0 && key <= SDLK_KP9) { if (key >= SDLK_KP0 && key <= SDLK_KP9) {
return key - SDLK_KP0 + '0'; return key - SDLK_KP0 + '0';
@ -2265,7 +2270,6 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) {
bool OSystem_WINCE3::pollEvent(Common::Event &event) { bool OSystem_WINCE3::pollEvent(Common::Event &event) {
SDL_Event ev; SDL_Event ev;
ev.type = SDL_NOEVENT; ev.type = SDL_NOEVENT;
byte b = 0;
DWORD currentTime; DWORD currentTime;
bool keyEvent = false; bool keyEvent = false;
int deltaX, deltaY; int deltaX, deltaY;

View file

@ -25,12 +25,12 @@
#include "gui/Actions.h" #include "gui/Actions.h"
#include "gui/message.h" #include "gui/message.h"
#include "scumm/scumm.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#include "backends/platform/wince/CEActionsPocket.h" #include "backends/platform/wince/CEActionsPocket.h"
#include "backends/platform/wince/CEActionsSmartphone.h" #include "backends/platform/wince/CEActionsSmartphone.h"
#include "backends/platform/wince/CEDevice.h"
#elif defined(__SYMBIAN32__) #elif defined(__SYMBIAN32__)
#include "backends/platform/symbian/src/SymbianActions.h" #include "backends/platform/symbian/src/SymbianActions.h"
#endif #endif