diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-05-09 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-05-09 18:00:00 +0200 |
commit | ae8a947367b4be57c9b0ca7bbf0032de0e2018d3 (patch) | |
tree | f9a5b6c7d320222b841a54c86590eb012ab3a107 /plugin.h | |
parent | c9a5d8ea5328e4a8bcb0c3423b825c02cb0c3b27 (diff) | |
download | vdr-patch-lnbsharing-ae8a947367b4be57c9b0ca7bbf0032de0e2018d3.tar.gz vdr-patch-lnbsharing-ae8a947367b4be57c9b0ca7bbf0032de0e2018d3.tar.bz2 |
Version 1.1.0vdr-1.1.0
- Begin of the 1.1 development branch. THIS IS NOT A STABLE VERSION!
The current stable version for every day use is still the 1.0 branch.
- First step towards a universal plugin interface. See the file PLUGINS.html
for a detailed description. The man page vdr(1) describes the new options '-L'
and '-P' used to load plugins. This first step implements the complete "outer"
shell for plugins. The "inner" access to VDR data structures will follow.
- The VDR version number is now displayed in the title line of the "Setup" menu.
Diffstat (limited to 'plugin.h')
-rw-r--r-- | plugin.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/plugin.h b/plugin.h new file mode 100644 index 0000000..99f330d --- /dev/null +++ b/plugin.h @@ -0,0 +1,81 @@ +/* + * plugin.h: The VDR plugin interface + * + * See the main source file 'vdr.c' for copyright information and + * how to reach the author. + * + * $Id: plugin.h 1.1 2002/05/09 10:16:09 kls Exp $ + */ + +#ifndef __PLUGIN_H +#define __PLUGIN_H + +#include "i18n.h" +#include "menuitems.h" +#include "osd.h" +#include "tools.h" + +#define VDRPLUGINCREATOR(PluginClass) extern "C" void *VDRPluginCreator(void) { return new PluginClass; } + +class cPlugin { + friend class cDll; +private: + const char *name; + void SetName(const char *s); +public: + cPlugin(void); + virtual ~cPlugin(); + + const char *Name(void) { return name; } + virtual const char *Version(void) = 0; + virtual const char *Description(void) = 0; + virtual const char *CommandLineHelp(void); + + virtual bool ProcessArgs(int argc, char *argv[]); + virtual void Start(void); + + virtual const char *MainMenuEntry(void); + virtual cOsdMenu *MainMenuAction(void); + + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); + void SetupStore(const char *Name, const char *Value = NULL); + void SetupStore(const char *Name, int Value); + + void RegisterI18n(const tI18nPhrase * const Phrases); + }; + +class cDll : public cListObject { +private: + char *fileName; + char *args; + void *handle; + cPlugin *plugin; +public: + cDll(const char *FileName, const char *Args); + virtual ~cDll(); + bool Load(bool Log = false); + cPlugin *Plugin(void) { return plugin; } + }; + +class cDlls : public cList<cDll> {}; + +class cPluginManager { +private: + static cPluginManager *pluginManager; + char *directory; + cDlls dlls; +public: + cPluginManager(const char *Directory); + virtual ~cPluginManager(); + void SetDirectory(const char *Directory); + void AddPlugin(const char *Args); + bool LoadPlugins(bool Log = false); + void StartPlugins(void); + static bool HasPlugins(void); + static cPlugin *GetPlugin(int Index); + static cPlugin *GetPlugin(const char *Name); + void Shutdown(bool Log = false); + }; + +#endif //__PLUGIN_H |