[Scummvm-cvs-logs] scummvm master -> d127843859b9cba52aee9c1d9a4944a7eb247c1f

lordhoto lordhoto at gmail.com
Mon Feb 13 01:24:53 CET 2012


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d811240a9d ALL: Enable Keymapper specific OSystem API only when the Keymapper is enabled.
d127843859 COMMON: Enable backend specific custom events only when the Keymapper is enabled.


Commit: d811240a9d38098f5b1f77b7d8dbef7a947f9a67
    https://github.com/scummvm/scummvm/commit/d811240a9d38098f5b1f77b7d8dbef7a947f9a67
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-02-12T16:20:02-08:00

Commit Message:
ALL: Enable Keymapper specific OSystem API only when the Keymapper is enabled.

Changed paths:
    backends/modular-backend.h
    backends/platform/linuxmoto/hardwarekeys.cpp
    backends/platform/linuxmoto/linuxmoto-sdl.h
    backends/platform/maemo/maemo.cpp
    backends/platform/maemo/maemo.h
    backends/platform/sdl/hardwarekeys.cpp
    backends/platform/sdl/sdl.h
    backends/platform/webos/webos.cpp
    backends/platform/webos/webos.h
    common/system.h



diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index b864da0..072ee80 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -105,13 +105,6 @@ public:
 
 	//@}
 
-	/** @name Events and Time */
-	//@{
-
-	virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
-
-	//@}
-
 	/** @name Mutex handling */
 	//@{
 
diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp
index e10e39a..cbd9dcc 100644
--- a/backends/platform/linuxmoto/hardwarekeys.cpp
+++ b/backends/platform/linuxmoto/hardwarekeys.cpp
@@ -106,9 +106,8 @@ static const Mod modifiers[] = {
 	{ KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true },
 	{ 0, 0, 0, false }
 };
-#endif
-
 
 Common::HardwareKeySet *OSystem_LINUXMOTO::getHardwareKeySet() {
 	return OSystem_SDL::getHardwareKeySet();
 }
+#endif
diff --git a/backends/platform/linuxmoto/linuxmoto-sdl.h b/backends/platform/linuxmoto/linuxmoto-sdl.h
index 97262cc..9a0be56 100644
--- a/backends/platform/linuxmoto/linuxmoto-sdl.h
+++ b/backends/platform/linuxmoto/linuxmoto-sdl.h
@@ -29,8 +29,10 @@ class OSystem_LINUXMOTO : public OSystem_POSIX {
 public:
 	virtual void initBackend();
 
+#ifdef ENABLE_KEYMAPPER
 	// FIXME: This just calls parent methods, is it needed?
 	virtual Common::HardwareKeySet *getHardwareKeySet();
+#endif
 };
 
 #endif
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index fe60bdc..728e8b4 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -129,16 +129,12 @@ void OSystem_SDL_Maemo::setupIcon() {
 	// http://bugzilla.libsdl.org/show_bug.cgi?id=586
 }
 
-Common::HardwareKeySet *OSystem_SDL_Maemo::getHardwareKeySet() {
 #ifdef ENABLE_KEYMAPPER
+Common::HardwareKeySet *OSystem_SDL_Maemo::getHardwareKeySet() {
 	return new Common::HardwareKeySet(Common::maemoKeys, Common::maemoModifiers);
-#else
-	return OSystem_POSIX::getHardwareKeySet();
-#endif
 }
 
 Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() {
-#ifdef ENABLE_KEYMAPPER
 	using namespace Common;
 	Keymap *globalMap = new Keymap("maemo");
 
@@ -160,10 +156,8 @@ Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() {
 	act->addRightClickEvent();
 
 	return globalMap;
-#else
-	return OSystem_POSIX::getGlobalKeymap();
-#endif
 }
+#endif
 
 void OSystem_SDL_Maemo::initObserver() {
 	assert(_eventManager);
diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h
index 821f352..3827702 100644
--- a/backends/platform/maemo/maemo.h
+++ b/backends/platform/maemo/maemo.h
@@ -41,8 +41,10 @@ public:
 	virtual void fatalError();
 	virtual void setWindowCaption(const char *caption);
 	virtual void setupIcon();
+#ifdef ENABLE_KEYMAPPER
 	virtual Common::HardwareKeySet *getHardwareKeySet();
 	virtual Common::Keymap *getGlobalKeymap();
+#endif
 
 	Model getModel() { return _model; }
 
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index 3e93786..1469698 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -174,13 +174,8 @@ static const ModifierTableEntry sdlModifiers[] = {
 	{ KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true },
 	{ 0, 0, 0, false }
 };
-#endif
-
 
 Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
-#ifdef ENABLE_KEYMAPPER
 	return new HardwareKeySet(sdlKeys, sdlModifiers);
-#else
-	return 0;
-#endif
 }
+#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 6c84c5c..1b0204a 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -63,7 +63,9 @@ public:
 	virtual void engineInit();
 	virtual void engineDone();
 #endif
+#ifdef ENABLE_KEYMAPPER
 	virtual Common::HardwareKeySet *getHardwareKeySet();
+#endif
 	virtual void quit();
 	virtual void fatalError();
 
diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp
index bfb19ed..abf572e 100644
--- a/backends/platform/webos/webos.cpp
+++ b/backends/platform/webos/webos.cpp
@@ -51,8 +51,8 @@ void OSystem_SDL_WebOS::initBackend() {
  *
  * @return The hardware key set with added webOS specific keys.
  */
-HardwareKeySet *OSystem_SDL_WebOS::getHardwareKeySet() {
 #ifdef ENABLE_KEYMAPPER
+HardwareKeySet *OSystem_SDL_WebOS::getHardwareKeySet() {
 	// Get the original SDL hardware key set
 	HardwareKeySet *keySet = OSystem_SDL::getHardwareKeySet();
 
@@ -62,9 +62,7 @@ HardwareKeySet *OSystem_SDL_WebOS::getHardwareKeySet() {
 
 	// Return the modified hardware key set
 	return keySet;
-#else
-	return 0;
-#endif
 }
+#endif
 
 #endif
diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h
index 850aaf9..71390a1 100644
--- a/backends/platform/webos/webos.h
+++ b/backends/platform/webos/webos.h
@@ -31,7 +31,9 @@ public:
 	OSystem_SDL_WebOS();
 
 	virtual void initBackend();
+#ifdef ENABLE_KEYMAPPER
 	virtual Common::HardwareKeySet *getHardwareKeySet();
+#endif
 };
 
 #endif
diff --git a/common/system.h b/common/system.h
index 2a651bb..c5e8214 100644
--- a/common/system.h
+++ b/common/system.h
@@ -51,8 +51,10 @@ class UpdateManager;
 class TimerManager;
 class SeekableReadStream;
 class WriteStream;
+#ifdef ENABLE_KEYMAPPER
 class HardwareKeySet;
 class Keymap;
+#endif
 }
 
 class AudioCDManager;
@@ -933,6 +935,7 @@ public:
 		return _eventManager;
 	}
 
+#ifdef ENABLE_KEYMAPPER
 	/**
 	 * Register hardware keys with keymapper
 	 *
@@ -952,6 +955,7 @@ public:
 	 * See keymapper documentation for further reference.
 	 */
 	virtual Common::Keymap *getGlobalKeymap() { return 0; }
+#endif
 	//@}
 
 


Commit: d127843859b9cba52aee9c1d9a4944a7eb247c1f
    https://github.com/scummvm/scummvm/commit/d127843859b9cba52aee9c1d9a4944a7eb247c1f
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-02-12T16:23:07-08:00

Commit Message:
COMMON: Enable backend specific custom events only when the Keymapper is enabled.

Otherwise there is no way of generating these events, thus it's better to make
people really aware of this.

I furthermore added some nots that its part of a WIP API, thus it should only
be used after checking up.

Changed paths:
    common/events.h



diff --git a/common/events.h b/common/events.h
index 04dfd39..d3c7064 100644
--- a/common/events.h
+++ b/common/events.h
@@ -72,8 +72,14 @@ enum EventType {
 	 * use events to ask for the save game dialog or to pause the engine.
 	 * An associated enumerated type can accomplish this.
 	 **/
-	EVENT_PREDICTIVE_DIALOG = 12,
+	EVENT_PREDICTIVE_DIALOG = 12
+
+#ifdef ENABLE_KEYMAPPER
+	,
+	// IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
+	// this, please talk to tsoliman and/or LordHoto.
 	EVENT_CUSTOM_BACKEND = 13
+#endif
 };
 
 typedef uint32 CustomEventType;
@@ -101,7 +107,11 @@ struct Event {
 	 */
 	Point mouse;
 
+#ifdef ENABLE_KEYMAPPER
+	// IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
+	// this, please talk to tsoliman and/or LordHoto.
 	CustomEventType customType;
+#endif
 
 	Event() : type(EVENT_INVALID), synthetic(false) {}
 };






More information about the Scummvm-git-logs mailing list