1 #ifndef GOFFICE_MODULE_PLUGIN_DEFS_H 2 #define GOFFICE_MODULE_PLUGIN_DEFS_H 3 4 #include <goffice/app/go-plugin.h> 5 #include <goffice/app/goffice-app.h> 6 #include <gmodule.h> 7 8 G_BEGIN_DECLS 9 10 typedef struct { 11 char const *key; /* object being versioned */ 12 char const *version; /* version id (strict equality is required) */ 13 } GOPluginModuleDepend; 14 typedef struct { 15 guint32 const magic_number; 16 guint32 const num_depends; 17 } GOPluginModuleHeader; 18 19 /* Cheesy api versioning 20 * bump this when external api changes. eventually we will just push this out 21 * into the module's link dependencies */ 22 #define GOFFICE_API_VERSION "0.0" 23 24 #define GOFFICE_MODULE_PLUGIN_MAGIC_NUMBER 0x476e756d 25 26 /* convenience header for goffice plugins */ 27 #define GOFFICE_PLUGIN_MODULE_HEADER \ 28 G_MODULE_EXPORT GOPluginModuleDepend const go_plugin_depends [] = { \ 29 { "goffice", GOFFICE_API_VERSION } \ 30 }; \ 31 G_MODULE_EXPORT GOPluginModuleHeader const go_plugin_header = \ 32 { GOFFICE_MODULE_PLUGIN_MAGIC_NUMBER, G_N_ELEMENTS (go_plugin_depends) } 33 34 /* the folowwing two functions are declared here, but are not 35 * implemented in libgoffice. Each plugin must implement one 36 * instance of both. */ 37 void go_plugin_init (GOPlugin *plugin, GOCmdContext *cc); 38 void go_plugin_shutdown (GOPlugin *plugin, GOCmdContext *cc); 39 40 G_END_DECLS 41 42 #endif /* GOFFICE_MODULE_PLUGIN_DEFS_H */ 43