From bf47fc3d5125846c517f935de1f5506b9bd3f056 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 3 Nov 2004 07:24:41 +0000 Subject: added helper api to list all plugins. (ep_construct): load authors into 2004-11-03 Not Zed * e-plugin.c (e_plugin_list_plugins): added helper api to list all plugins. (ep_construct): load authors into new list for them. (e_plugin_register_type): setup disabled list. (ep_construct): dont load the hooks if we're not enabled. (e_plugin_enable): make this a virutal method. (e_plugin_invoke): if we're disabled, noop. svn path=/trunk/; revision=27809 --- e-util/e-plugin.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'e-util/e-plugin.h') diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index 60635ae2dc..efc53d5108 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -13,6 +13,13 @@ typedef struct _EPluginClass EPluginClass; #define E_PLUGIN_CLASSID "org.gnome.evolution.plugin" +/* Structure to define the author(s) names and addresses */ +typedef struct _EPluginAuthor EPluginAuthor; +struct _EPluginAuthor { + char *name; + char *email; +}; + /** * struct _EPlugin - An EPlugin instance. * @@ -43,6 +50,7 @@ struct _EPlugin { char *name; char *domain; GSList *hooks; + GSList *authors; /* EPluginAuthor structures */ int enabled:1; }; @@ -59,6 +67,7 @@ struct _EPlugin { * @invoke: The invoke virtual method loads the plugin code, resolves * the function name, and marshals a simple pointer to execute the * plugin. + * @enable: Virtual method to enable/disable the plugin. * * The EPluginClass represents each plugin type. The type of each class is * registered in a global table and is used to instantiate a @@ -75,6 +84,7 @@ struct _EPluginClass { int (*construct)(EPlugin *, xmlNodePtr root); void *(*invoke)(EPlugin *, const char *name, void *data); + void (*enable)(EPlugin *, int state); }; GType e_plugin_get_type(void); @@ -82,6 +92,7 @@ GType e_plugin_get_type(void); int e_plugin_construct(EPlugin *ep, xmlNodePtr root); void e_plugin_add_load_path(const char *); int e_plugin_load_plugins(void); +GSList * e_plugin_list_plugins(void); void e_plugin_register_type(GType type); -- cgit v1.2.3