aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/system/libkvisystem.cpp
diff options
context:
space:
mode:
authorGravatar TheXception2007-04-12 20:37:06 +0000
committerGravatar TheXception2007-04-12 20:37:06 +0000
commitf7f5ef659b7b5d1353c51239fa9a42c0481819f1 (patch)
treed8c0a6b22ddfebb0fe2cf027821413baf6c30652 /src/modules/system/libkvisystem.cpp
parentmore QT4 fix: QSplitter (diff)
downloadKVIrc-f7f5ef659b7b5d1353c51239fa9a42c0481819f1.tar.gz
KVIrc-f7f5ef659b7b5d1353c51239fa9a42c0481819f1.tar.bz2
KVIrc-f7f5ef659b7b5d1353c51239fa9a42c0481819f1.zip
added $system.call() to call functions of dll/so files
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@485 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/system/libkvisystem.cpp')
-rw-r--r--src/modules/system/libkvisystem.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp
index 759f852e3..7c18e4064 100644
--- a/src/modules/system/libkvisystem.cpp
+++ b/src/modules/system/libkvisystem.cpp
@@ -25,6 +25,8 @@
#include "kvi_settings.h"
#include "kvi_module.h"
#include "kvi_string.h"
+#include "kvi_library.h"
+#include "kvi_thread.h"
#include "kvi_locale.h"
#include "kvi_qcstring.h"
@@ -47,6 +49,10 @@
#include "kvi_modulemanager.h"
+#include "plugin.h"
+
+KviPluginManager * g_pPluginManager;
+
/*
@doc: system.ostype
@type:
@@ -646,6 +652,27 @@ static bool system_kvs_cmd_setenv(KviKvsModuleCommandCall * c)
return true;
}
+/*
+ @doc: system.call
+ @keyterms:
+ call plugin
+ @type:
+ function
+ @title:
+ $system.call
+ @short:
+ Allows to call functions of a plugin
+ @syntax:
+ <string> $system.plugin(<plugin:string>, <function:string>[,<parameters:string>,...])
+ @description:
+ To be completed...
+*/
+
+
+static bool system_kvs_fnc_plugin_call(KviKvsModuleFunctionCall *c)
+{
+ return g_pPluginManager->PluginCall(c);
+}
static bool system_module_init(KviModule * m)
{
@@ -661,16 +688,27 @@ static bool system_module_init(KviModule * m)
KVSM_REGISTER_FUNCTION(m,"clipboard",system_kvs_fnc_clipboard);
KVSM_REGISTER_FUNCTION(m,"selection",system_kvs_fnc_selection);
KVSM_REGISTER_FUNCTION(m,"checkModule",system_kvs_fnc_checkModule);
+ KVSM_REGISTER_FUNCTION(m,"call",system_kvs_fnc_plugin_call);
KVSM_REGISTER_SIMPLE_COMMAND(m,"setenv",system_kvs_cmd_setenv);
KVSM_REGISTER_SIMPLE_COMMAND(m,"setClipboard",system_kvs_cmd_setClipboard);
KVSM_REGISTER_SIMPLE_COMMAND(m,"setSelection",system_kvs_cmd_setSelection);
+ g_pPluginManager = new(KviPluginManager);
+
return true;
}
static bool system_module_cleanup(KviModule *m)
{
+ g_pPluginManager->UnloadAll(true);
+ delete g_pPluginManager;
+ return true;
+}
+
+static bool system_module_can_unload(KviModule *m)
+{
+ if(!g_pPluginManager->CheckUnload()) return false;
return true;
}
@@ -682,7 +720,7 @@ KVIRC_MODULE(
" (C) 2005 Alessandro Carbone (noldor at barmes dot org)",// author & (C)
"System informations module",
system_module_init,
- 0,
+ system_module_can_unload,
0,
system_module_cleanup
)