[Scummvm-cvs-logs] SF.net SVN: scummvm: [32084] scummvm/trunk/base/plugins.h
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue May 13 13:00:28 CEST 2008
Revision: 32084
http://scummvm.svn.sourceforge.net/scummvm/?rev=32084&view=rev
Author: fingolfin
Date: 2008-05-13 04:00:25 -0700 (Tue, 13 May 2008)
Log Message:
-----------
Some more Doxygen comments, as well as some FIXMEs/TODOs
Modified Paths:
--------------
scummvm/trunk/base/plugins.h
Modified: scummvm/trunk/base/plugins.h
===================================================================
--- scummvm/trunk/base/plugins.h 2008-05-13 10:41:32 UTC (rev 32083)
+++ scummvm/trunk/base/plugins.h 2008-05-13 11:00:25 UTC (rev 32084)
@@ -31,6 +31,28 @@
#include "common/singleton.h"
#include "base/game.h"
+
+/**
+ * @page pagePlugins An overview of the ScummVM plugin system
+ * This is a brief overview of how plugins (dynamically loadable code modules)
+ * work in ScummVM. We will explain how to write plugins, how they work internally,
+ * and sketch how porters can add support for them in their ports.
+ *
+ * \section secPluginImpl Implementing a plugin
+ * TODO
+ *
+ * \section secPluginUse Using plugins
+ * TODO
+ *
+ * \section secPluginInternals How plugins work internally
+ * TODO
+ *
+ * \section secPluginBackend How to add support for dynamic plugins to a port
+ * TODO
+ */
+
+
+
// Plugin versioning
/** Global Plugin API version */
@@ -113,6 +135,8 @@
* 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.
+ *
+ * FIXME: This class needs better documentation, esp. how it differs from class Plugin
*/
class PluginObject {
public:
@@ -126,6 +150,8 @@
* Abstract base class for the plugin system.
* Subclasses for this can be used to wrap both static and dynamic
* plugins.
+ *
+ * FIXME: This class needs better documentation, esp. how it differs from class PluginObject
*/
class Plugin {
protected:
@@ -180,6 +206,8 @@
* loading/unloading them (by invoking the appropriate Plugin methods).
* Furthermore, the caller is responsible for deleting these objects
* eventually.
+ *
+ * @return a list of Plugin instances
*/
virtual PluginList getPlugins() = 0;
};
@@ -191,6 +219,15 @@
*/
class FilePluginProvider : public PluginProvider {
public:
+ /**
+ * Return a list of Plugin objects loaded via createPlugin from disk.
+ * For this, a list of directories is searched for plugin objects:
+ * The current dir and its "plugins" subdirectory (if present), a list
+ * of custom search dirs (see addCustomDirectories) and finally the
+ * directory specified via the "pluginspath" config variable (if any).
+ *
+ * @return a list of Plugin instances
+ */
virtual PluginList getPlugins();
protected:
@@ -200,13 +237,22 @@
* If the file is not found, or does not contain loadable code, 0 is returned instead.
*
* @param filename the name of the loadable code module
- * @return a pointer to a Plugin instance, or 0 if an error occured.
+ * @return a pointer to a Plugin instance, or 0 if an error occurred.
+ *
+ * FIXME: Instead of using getPrefix & getSuffix, how about adding a
+ * isPluginFilename() class, so that more flexible checks can be performed?
*/
virtual Plugin* createPlugin(const Common::String &filename) const = 0;
virtual const char* getPrefix() const;
virtual const char* getSuffix() const;
+ /**
+ * Optionally add to the list of directories to be searched for
+ * plugins by getPlugins().
+ *
+ * FIXME: This should be using FSNodes, not strings!
+ */
virtual void addCustomDirectories(Common::StringList &dirs) const;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list