aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien2011-06-16 11:24:38 -0400
committerJulien2011-06-16 14:27:06 -0400
commit599695bc4f70c28c556e2c78822eda6ef29d2faa (patch)
tree8f64b70bf72fd1b331245a0199547362818a0d2b
parent5dff6c2c081756feb61fd273da903019e33363a1 (diff)
downloadscummvm-rg350-599695bc4f70c28c556e2c78822eda6ef29d2faa.tar.gz
scummvm-rg350-599695bc4f70c28c556e2c78822eda6ef29d2faa.tar.bz2
scummvm-rg350-599695bc4f70c28c556e2c78822eda6ef29d2faa.zip
COMMON: Change TaskbarManager to the new module slot interface
-rw-r--r--backends/modular-backend.cpp16
-rw-r--r--backends/modular-backend.h15
-rw-r--r--common/system.cpp9
-rw-r--r--common/system.h15
4 files changed, 27 insertions, 28 deletions
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 4b306be228..525170d685 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -35,9 +35,7 @@ ModularBackend::ModularBackend()
_mutexManager(0),
_graphicsManager(0),
_mixer(0) {
-#if defined(USE_TASKBAR)
- _taskbarManager = 0;
-#endif
+
}
ModularBackend::~ModularBackend() {
@@ -45,10 +43,6 @@ ModularBackend::~ModularBackend() {
_graphicsManager = 0;
delete _mixer;
_mixer = 0;
-#if defined(USE_TASKBAR)
- delete _taskbarManager;
- _taskbarManager = 0;
-#endif
delete _mutexManager;
_mutexManager = 0;
}
@@ -241,11 +235,3 @@ void ModularBackend::displayMessageOnOSD(const char *msg) {
void ModularBackend::quit() {
exit(0);
}
-
-#if defined(USE_TASKBAR)
-Common::TaskbarManager *ModularBackend::getTaskbarManager() {
- assert(_taskbarManager);
- return _taskbarManager;
-}
-#endif
-
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index fab7fb6a4d..3593130bf5 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -27,21 +27,20 @@
class GraphicsManager;
class MutexManager;
-class TaskbarManager;
/**
* Base class for modular backends.
- *
+ *
* It wraps most functions to their manager equivalent, but not
* all OSystem functions are implemented here.
- *
+ *
* A backend derivated from this class, will need to implement
* these functions on its own:
* OSystem::pollEvent()
* OSystem::getMillis()
* OSystem::delayMillis()
* OSystem::getTimeAndDate()
- *
+ *
* And, it should also initialize all the managers variables
* declared in this class, or override their related functions.
*/
@@ -112,7 +111,7 @@ public:
virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
//@}
-
+
/** @name Mutex handling */
//@{
@@ -134,9 +133,6 @@ public:
//@{
virtual void quit();
-#if defined(USE_TASKBAR)
- virtual TaskbarManager *getTaskbarManager();
-#endif
virtual void displayMessageOnOSD(const char *msg);
//@}
@@ -145,9 +141,6 @@ protected:
/** @name Managers variables */
//@{
-#if defined(USE_TASKBAR)
- TaskbarManager *_taskbarManager;
-#endif
MutexManager *_mutexManager;
GraphicsManager *_graphicsManager;
Audio::Mixer *_mixer;
diff --git a/common/system.cpp b/common/system.cpp
index fae7a3ef34..2dab687872 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -32,6 +32,7 @@
#include "common/fs.h"
#include "common/savefile.h"
#include "common/str.h"
+#include "common/taskbar.h"
#include "common/textconsole.h"
#include "backends/audiocd/default/default-audiocd.h"
@@ -45,6 +46,9 @@ OSystem::OSystem() {
_eventManager = 0;
_timerManager = 0;
_savefileManager = 0;
+#if defined(USE_TASKBAR)
+ _taskbarManager = 0;
+#endif
_fsFactory = 0;
}
@@ -58,6 +62,11 @@ OSystem::~OSystem() {
delete _timerManager;
_timerManager = 0;
+#if defined(USE_TASKBAR)
+ delete _taskbarManager;
+ _taskbarManager = 0;
+#endif
+
delete _savefileManager;
_savefileManager = 0;
diff --git a/common/system.h b/common/system.h
index 0bfa980800..24728a918c 100644
--- a/common/system.h
+++ b/common/system.h
@@ -43,7 +43,7 @@ class SaveFileManager;
class SearchSet;
class String;
#if defined(USE_TASKBAR)
- class TaskbarManager;
+class TaskbarManager;
#endif
class TimerManager;
class SeekableReadStream;
@@ -152,6 +152,15 @@ protected:
*/
Common::SaveFileManager *_savefileManager;
+#if defined(USE_TASKBAR)
+ /**
+ * No default value is provided for _savefileManager by OSystem.
+ *
+ * @note _savefileManager is deleted by the OSystem destructor.
+ */
+ Common::TaskbarManager *_taskbarManager;
+#endif
+
/**
* No default value is provided for _fsFactory by OSystem.
*
@@ -1057,7 +1066,9 @@ public:
*
* @return the TaskbarManager for the current architecture
*/
- virtual Common::TaskbarManager *getTaskbarManager() = 0;
+ virtual Common::TaskbarManager *getTaskbarManager() {
+ return _taskbarManager;
+ }
#endif
/**