#ifndef _E_PLUGIN_H #define _E_PLUGIN_H #include #include #include /* ********************************************************************** */ typedef struct _EPlugin EPlugin; 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. * * @object: Superclass. * @id: Unique identifier for plugin instance. * @path: Filename where the xml definition resides. * @hooks_pending: A list hooks which can't yet be loaded. This is * the xmlNodePtr to the root node of the hook definition. * @description: A description of the plugin's purpose. * @name: The name of the plugin. * @domain: The translation domain for this plugin. * @hooks: A list of the EPluginHooks this plugin requires. * @enabled: Whether the plugin is enabled or not. This is not fully * implemented. * * The base EPlugin object is used to represent each plugin directly. * All of the plugin's hooks are loaded and managed through this * object. **/ struct _EPlugin { GObject object; char *id; char *path; GSList *hooks_pending; char *description; char *name; char *domain; GSList *hooks; GSList *authors; /* EPluginAuthor structures */ int enabled:1; }; /** * struct _EPluginClass - * * @class: Superclass. * @type: The plugin type. This is used by the plugin loader to * determine which plugin object to instantiate to handle the plugin. * This must be overriden by each subclass to provide a unique name. * @construct: The construct virtual method scans the XML tree to * initialise itself. * @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 * container for each plugin. * * It provides two main functions, to load the plugin definition, and * to invoke a function. Each plugin class is used to handle mappings * to different languages. **/ struct _EPluginClass { GObjectClass class; const char *type; int (*construct)(EPlugin *, xmlNodePtr root); void *(*invoke)(EPlugin *, const char *name, void *data); void (*enable)(EPlugin *, int state); }; 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); void *e_plugin_invoke(EPlugin *ep, const char *name, void *data); void e_plugin_enable(EPlugin *eph, int state); /* static helpers */ /* maps prop or content to 'g memory' */ char *e_plugin_xml_prop(xmlNodePtr node, const char *id); char *e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain); int e_plugin_xml_int(xmlNodePtr node, const char *id, int def); char *e_plugin_xml_content(xmlNodePtr node); char *e_plugin_xml_content_domain(xmlNodePtr node, const char *domain); /* ********************************************************************** */ #include typedef struct _EPluginLib EPluginLib; typedef struct _EPluginLibClass EPluginLibClass; /* The callback signature used for epluginlib methods */ typedef void *(*EPluginLibFunc)(EPluginLib *ep, void *data); /* The setup method, this will be called when the plugin is * initialised. In the future it may also be called when the plugin * is disabled. */ typedef int (*EPluginLibEnableFunc)(EPluginLib *ep, int enable); /** * struct _EPluginLib - * * @plugin: Superclass. * @location: The filename of the shared object. * @module: The GModule once it is loaded. * * This is a concrete EPlugin class. It loads and invokes dynamically * loaded libraries using GModule. The shared object isn't loaded * until the first callback is invoked. * * When the plugin is loaded, and if it exists, "e_plugin_lib_enable" * will be invoked to initialise the **/ struct _EPluginLib { EPlugin plugin; char *location; GModule *module; }; /** * struct _EPluginLibClass - * * @plugin_class: Superclass. * * The plugin library needs no additional class data. **/ struct _EPluginLibClass { EPluginClass plugin_class; }; GType e_plugin_lib_get_type(void); /* ********************************************************************** */ typedef struct _EPluginHook EPluginHook; typedef struct _EPluginHookClass EPluginHookClass; /* utilities for subclasses to use */ typedef struct _EPluginHookTargetMap EPluginHookTargetMap; typedef struct _EPluginHookTargetKey EPluginHookTargetKey; /** * struct _EPluginHookTargetKey - * * @key: Enumeration value as a string. * @value: Enumeration value as an integer. * * A multi-purpose string to id mapping structure used with various * helper functions to simplify plugin hook subclassing. **/ struct _EPluginHookTargetKey { const char *key; guint32 value; }; /** * struct _EPluginHookTargetMap - * * @type: The string id of the target. * @id: The integer id of the target. Maps directly to the type field * of the various plugin type target id's. * @mask_bits: A zero-fill terminated array of EPluginHookTargetKeys. * * Used by EPluginHook to define mappings of target type enumerations * to and from strings. Also used to define the mask option names * when reading the XML plugin hook definitions. **/ struct _EPluginHookTargetMap { const char *type; int id; const struct _EPluginHookTargetKey *mask_bits; /* null terminated array */ }; /** * struct _EPluginHook - A plugin hook. * * @object: Superclass. * @plugin: The parent object. * * An EPluginHook is used as a container for each hook a given plugin * is listening to. **/ struct _EPluginHook { GObject object; struct _EPlugin *plugin; }; /** * struct _EPluginHookClass - * * @class: Superclass. * @id: The plugin hook type. This must be overriden by each subclass * and is used as a key when loading hook definitions. This string * should contain a globally unique name followed by a : and a version * specification. This is to ensure plugins only hook into hooks with * the right API. * @construct: Virtual method used to initialise the object when * loaded. * @enable: Virtual method used to enable or disable the hook. * * The EPluginHookClass represents each hook type. The type of the * class is registered in a global table and is used to instantiate a * container for each hook. **/ struct _EPluginHookClass { GObjectClass class; const char *id; int (*construct)(EPluginHook *eph, EPlugin *ep, xmlNodePtr root); void (*enable)(EPluginHook *eph, int state); }; GType e_plugin_hook_get_type(void); void e_plugin_hook_register_type(GType type); EPluginHook * e_plugin_hook_new(EPlugin *ep, xmlNodePtr root); void e_plugin_hook_enable(EPluginHook *eph, int state); /* static methods */ guint32 e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop); guint32 e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *prop); #endif /* ! _E_PLUGIN_H */ 580af6467d2c8c81b0b0ea08055c465a5f47d'>Geresh is a multi lingual text editor, but there are a few featurestabthorpe2009-02-246-0/+105 * The KDE FreeBSD team is proud to announce the release of KDE 4.2.0miwi2009-02-095-330/+157 * Update to 1.0,makc2009-01-253-8/+10 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-292-6/+6 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-184-20/+128 * - Reset maintainer address:pav2008-06-191-1/+1 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-062-1/+2 * Unbreak by fixing some old code. Fix a typo in pkg-descr.mi2008-05-223-8/+13 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-203-13/+11 * Fix distfile location for outdated koffice-l10ns.lofi2007-11-091-1/+1 * Update to KDE 3.5.8lofi2007-10-304-8/+6 * Revert more PORTREVISION accidentslofi2007-07-051-0/+1 * Update to KDE 3.5.7 / KOffice 1.6.3lofi2007-07-045-9/+6 * BROKEN with gcc 4.2kris2007-05-271-1/+7 * - Welcome X.org 7.2 \o/.flz2007-05-206-1/+6 * Update to KDE 3.5.6 / KOffice 1.6.2lofi2007-03-144-6/+10 * Really normalize Aspell dictionaries ports PKGVERSION...thierry2007-02-151-1/+1 * Upgrade to 1.0-0.thierry2007-02-132-4/+4 * Normalize Aspell dictionaries PKGNAMEs.thierry2007-01-141-0/+1 * Update to KDE 3.5.5 / KOffice 1.6.1lofi2006-12-204-6/+122 * KDE 3.5.4 / KOffice 1.5.2lofi2006-09-136-10/+12 * All dictionaries can be installed separately:thierry2006-07-154-7/+17 * Update to KDE 3.5.3lofi2006-06-064-22/+20 * Update to KOffice 1.5.1lofi2006-05-272-4/+4 * Update to KOffice 1.5.0lofi2006-04-293-22/+8 * Update to KDE 3.5.2lofi2006-03-314-128/+22 * Conversion to a single libtool environment.ade2006-02-231-1/+1 * Update to KDE 3.5.1.lofi2006-02-014-8/+18 * SHA256ifyedwin2006-01-224-0/+4 * Update to KDE 3.5.0lofi2006-01-094-74/+82 * - Add SHA256pav2005-11-251-0/+1 * Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-151-1/+1 * Update to 0.101mnag2005-11-072-3/+3 * Update to KDE 3.4.3 / KOffice 1.4.2lofi2005-11-054-6/+34 * Remove all the secondary port of editors/ooodict-allmaho2005-11-012-20/+0 * Fix index build by moving openoffice.org-1.1 ports.maho2005-08-291-1/+1 * Update to KDE 3.4.2 / KOffice 1.4.1lofi2005-08-012-4/+4 * Update to KDE 3.4.1lofi2005-06-264-22/+30 * - Fix categoriespav2005-06-061-0/+1 * - Unbreak and general updatepav2005-06-062-0/+19 * change the libtool version to use from 1.3 to 1.5oliver2005-06-031-1/+1 * Update to KDE 3.4lofi2005-03-214-78/+34 * Add i18nized doc subdirs to kdehier and adjust i18n port plists accordingly.lofi2004-12-232-2/+0 * Fix kde3-i18n ports.lofi2004-12-162-4/+4 * Update to KDE 3.3.2lofi2004-12-148-12/+12 * Update to 0.8arved2004-12-025-30/+12 * - Update maintainer's email addresspav2004-11-152-4/+4 * Update to KDE 3.3.1lofi2004-11-086-7/+35