diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-21 10:44:29 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-21 10:44:29 +0200 |
commit | 06a27f142b65cef811d7e0a5931d54ed15725a7d (patch) | |
tree | 9a66120247458d54463fbee543261cb567365b0d /plugin.c | |
parent | 7533b69e9b67d5d2e6df4bef8af17fa02c068f0d (diff) | |
download | vdr-06a27f142b65cef811d7e0a5931d54ed15725a7d.tar.gz vdr-06a27f142b65cef811d7e0a5931d54ed15725a7d.tar.bz2 |
Added 'Service' functions to the plugin interface
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 1.13 2005/01/30 14:05:20 kls Exp $ + * $Id: plugin.c 1.14 2005/08/21 09:35:28 kls Exp $ */ #include "plugin.h" @@ -99,6 +99,11 @@ void cPlugin::SetupStore(const char *Name, int Value) Setup.Store(Name, Value, this->Name()); } +bool cPlugin::Service(const char *Id, void *Data) +{ + return false; +} + void cPlugin::RegisterI18n(const tI18nPhrase * const Phrases) { I18nRegister(Phrases, Name()); @@ -372,6 +377,31 @@ cPlugin *cPluginManager::GetPlugin(const char *Name) return NULL; } +cPlugin *cPluginManager::CallFirstService(const char *Id, void *Data) +{ + if (pluginManager) { + for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) { + cPlugin *p = dll->Plugin(); + if (p && p->Service(Id, Data)) + return p; + } + } + return NULL; +} + +bool cPluginManager::CallAllServices(const char *Id, void *Data) +{ + bool found=false; + if (pluginManager) { + for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) { + cPlugin *p = dll->Plugin(); + if (p && p->Service(Id, Data)) + found = true; + } + } + return found; +} + void cPluginManager::StopPlugins(void) { for (cDll *dll = dlls.Last(); dll; dll = dlls.Prev(dll)) { |