aboutsummaryrefslogtreecommitdiff
path: root/backends/modular-backend.h
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-02 06:44:42 +0000
committerAlejandro Marzini2010-07-02 06:44:42 +0000
commitf9c3a4547cbf1b1942402d618fa403a7fb1cb656 (patch)
tree63bb999ef23998b17aea9f5bc9712bc2a8f9bfbf /backends/modular-backend.h
parent055fc3282f73bd9aa64cec2661258d3baf5ec66e (diff)
downloadscummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.gz
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.bz2
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.zip
Cleanup and documentation.
svn-id: r50589
Diffstat (limited to 'backends/modular-backend.h')
-rw-r--r--backends/modular-backend.h63
1 files changed, 60 insertions, 3 deletions
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index e4bc843dbe..2b95d31dc5 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -34,15 +34,41 @@
#include "backends/mutex/null/null-mutex.h"
#include "backends/graphics/null/null-graphics.h"
+/**
+ * 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::createConfigReadStream()
+ * OSystem::createConfigWriteStream()
+ * OSystem::getMillis()
+ * OSystem::delayMillis()
+ * OSystem::getTimeAndDate()
+ *
+ * And, it should also initialize all the managers variables
+ * declared in this class, or override their related functions.
+ */
class ModularBackend : public OSystem, public Common::EventSource {
public:
ModularBackend();
virtual ~ModularBackend();
+ /** @name Features */
+ //@{
+
virtual bool hasFeature(Feature f);
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
+ //@}
+
+ /** @name Graphics */
+ //@{
+
virtual const GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
@@ -85,26 +111,56 @@ public:
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void disableCursorPalette(bool disable);
+ //@}
+
+ /** @name Events and Time */
+ //@{
+
virtual Common::TimerManager *getTimerManager();
virtual Common::EventManager *getEventManager();
virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
+ //@}
+
+ /** @name Mutex handling */
+ //@{
+
virtual MutexRef createMutex();
virtual void lockMutex(MutexRef mutex);
virtual void unlockMutex(MutexRef mutex);
virtual void deleteMutex(MutexRef mutex);
+ //@}
+
+ /** @name Sound */
+ //@{
+
virtual Audio::Mixer *getMixer();
+ //@}
+
+ /** @name Audio CD */
+ //@{
+
virtual AudioCDManager *getAudioCDManager();
+ //@}
+
+ /** @name Miscellaneous */
+ //@{
+
+ virtual Common::SaveFileManager *getSavefileManager();
+ virtual FilesystemFactory *getFilesystemFactory();
virtual void quit() { exit(0); }
virtual void setWindowCaption(const char *caption) {}
virtual void displayMessageOnOSD(const char *msg);
- virtual Common::SaveFileManager *getSavefileManager();
- virtual FilesystemFactory *getFilesystemFactory();
+
+ //@}
protected:
+ /** @name Managers variables */
+ //@{
+
FilesystemFactory *_fsFactory;
Common::EventManager *_eventManager;
Common::SaveFileManager *_savefileManager;
@@ -113,7 +169,8 @@ protected:
GraphicsManager *_graphicsManager;
Audio::Mixer *_mixer;
AudioCDManager *_audiocdManager;
-};
+ //@}
+};
#endif