diff options
author | Jordi Vilalta Prat | 2008-02-04 18:38:22 +0000 |
---|---|---|
committer | Jordi Vilalta Prat | 2008-02-04 18:38:22 +0000 |
commit | e4ab5dd33964c536ca1813e4a78373dda0008052 (patch) | |
tree | 1ff9af75ed432825cd6084b9a6cbe0a3b74a4c24 /base/plugins.h | |
parent | 468e9cb056382043008a1ffbbf09acbeb972d1ec (diff) | |
download | scummvm-rg350-e4ab5dd33964c536ca1813e4a78373dda0008052.tar.gz scummvm-rg350-e4ab5dd33964c536ca1813e4a78373dda0008052.tar.bz2 scummvm-rg350-e4ab5dd33964c536ca1813e4a78373dda0008052.zip |
Change MetaEngine references to PluginObject where possible to make its semantics more generic.
svn-id: r30789
Diffstat (limited to 'base/plugins.h')
-rw-r--r-- | base/plugins.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/base/plugins.h b/base/plugins.h index bc65a13644..e91ed80aa4 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -33,9 +33,23 @@ #include "common/util.h" #include "base/game.h" +/** + * Abstract base class for the plugin objects which handle plugins + * instantiation. Subclasses for this may be used for engine plugins + * and other types of plugins. + */ +class PluginObject { +public: + virtual ~PluginObject() {} + + /** Returns the name of the plugin. */ + virtual const char *getName() const = 0; +}; + +#include "engines/metaengine.h" + class Engine; class FSList; -class MetaEngine; class OSystem; /** @@ -45,10 +59,10 @@ class OSystem; */ class Plugin { protected: - MetaEngine *_metaengine; + PluginObject *_pluginObject; public: - Plugin() : _metaengine(0) {} + Plugin() : _pluginObject(0) {} virtual ~Plugin() { //if (isLoaded()) //unloadPlugin(); @@ -81,16 +95,16 @@ public: */ #ifndef DYNAMIC_MODULES -#define REGISTER_PLUGIN(ID,METAENGINE) \ - MetaEngine *g_##ID##_MetaEngine_alloc() { \ - return new METAENGINE(); \ +#define REGISTER_PLUGIN(ID,PLUGINCLASS) \ + PluginObject *g_##ID##_getObject() { \ + return new PLUGINCLASS(); \ } \ void dummyFuncToAllowTrailingSemicolon() #else -#define REGISTER_PLUGIN(ID,METAENGINE) \ +#define REGISTER_PLUGIN(ID,PLUGINCLASS) \ extern "C" { \ - PLUGIN_EXPORT MetaEngine *PLUGIN_MetaEngine_alloc() { \ - return new METAENGINE(); \ + PLUGIN_EXPORT PluginObject *PLUGIN_getObject() { \ + return new PLUGINCLASS(); \ } \ } \ void dummyFuncToAllowTrailingSemicolon() |