From 81a1525568ec94fd82b55e2d74510ec8c8fcdb5f Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Thu, 26 Jul 2007 11:28:11 +0000 Subject: Plugins should be configurable within the plugin-manager itself. Fixes Preferences dialog bloating. See bug #459522 svn path=/trunk/; revision=33847 --- e-util/ChangeLog | 9 +++++++++ e-util/e-plugin.c | 34 ++++++++++++++++++++++++++++++++++ e-util/e-plugin.h | 3 +++ 3 files changed, 46 insertions(+) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 96bcbc6320..b28edc8806 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2007-07-26 Sankar P + + * e-plugin.c: (e_plugin_configure), (epl_configure), + (epl_class_init): + * e-plugin.h: + Plugins should be configurable within the plugin-manager itself. + Fixes Preferences dialog bloating. + See bug #459522 + 2007-07-06 Matthew Barnes ** Fixes part of bug #446894 diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index cb0364d6be..28d6c962fa 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -681,6 +681,21 @@ e_plugin_enable(EPlugin *ep, int state) ((EPluginClass *)G_OBJECT_GET_CLASS(ep))->enable(ep, state); } +/** +* e_plugin_configure: +* @ep: +* +* +**/ + +void +e_plugin_configure (EPlugin *ep) +{ + EPluginClass *ptr; + ptr = ((EPluginClass *)G_OBJECT_GET_CLASS(ep)); + ptr->configure (ep); +} + /** * e_plugin_xml_prop: * @node: An XML node. @@ -911,6 +926,24 @@ epl_construct(EPlugin *ep, xmlNodePtr root) return 0; } +static void +epl_configure (EPlugin *ep) +{ + EPluginLibConfigureFunc configure; + + pd(printf ("\n epl_configure \n")); + + if (epl_loadmodule(ep) != 0) { + pd(printf ("\n epl_loadmodule \n")); + return; + } + + if (g_module_symbol(epl->module, "e_plugin_lib_configure", (void *)&configure)) { + pd(printf ("\n g_module_symbol is loaded\n")); + configure (epl); + } +} + static void epl_enable(EPlugin *ep, int state) { @@ -958,6 +991,7 @@ epl_class_init(EPluginClass *klass) klass->construct = epl_construct; klass->invoke = epl_invoke; klass->enable = epl_enable; + klass->configure = epl_configure; klass->type = "shlib"; } diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index e6f04504d9..eeda139878 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -85,6 +85,7 @@ struct _EPluginClass { int (*construct)(EPlugin *, xmlNodePtr root); void *(*invoke)(EPlugin *, const char *name, void *data); void (*enable)(EPlugin *, int state); + void (*configure)(EPlugin *); }; GType e_plugin_get_type(void); @@ -98,6 +99,7 @@ void e_plugin_register_type(GType type); void *e_plugin_invoke(EPlugin *ep, const char *name, void *data); void e_plugin_enable(EPlugin *eph, int state); +void e_plugin_configure (EPlugin *eph); /* static helpers */ /* maps prop or content to 'g memory' */ @@ -119,6 +121,7 @@ typedef void *(*EPluginLibFunc)(EPluginLib *ep, void *data); * initialised. In the future it may also be called when the plugin * is disabled. */ typedef int (*EPluginLibEnableFunc)(EPluginLib *ep, int enable); +typedef int (*EPluginLibConfigureFunc)(EPluginLib *ep); /** * struct _EPluginLib - -- cgit