1 /* 2 * go-graph-item-impl.h : Implementation details for the abstract graph-item 3 * interface 4 * 5 * Copyright (C) 2001 Zbigniew Chyla (cyba@gnome.pl) 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of the 10 * License, or (at your option) version 3. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 20 * USA 21 */ 22 23 #ifndef GO_PLUGIN_SERVICE_IMPL_H 24 #define GO_PLUGIN_SERVICE_IMPL_H 25 26 #include <goffice/app/goffice-app.h> 27 #include <glib-object.h> 28 #include <libxml/tree.h> 29 30 G_BEGIN_DECLS 31 32 struct _GOPluginService { 33 GObject g_object; 34 35 char *id; 36 GOPlugin *plugin; 37 gboolean is_loaded; 38 39 /* protected */ 40 gpointer cbs_ptr; 41 gboolean is_active; 42 43 /* private */ 44 char *saved_description; 45 }; 46 47 typedef struct { 48 GObjectClass g_object_class; 49 50 void (*read_xml) (GOPluginService *service, xmlNode *tree, GOErrorInfo **ret_error); 51 void (*activate) (GOPluginService *service, GOErrorInfo **ret_error); 52 void (*deactivate) (GOPluginService *service, GOErrorInfo **ret_error); 53 char *(*get_description) (GOPluginService *service); 54 } GOPluginServiceClass; 55 56 #define GO_PLUGIN_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_PLUGIN_SERVICE, GOPluginServiceClass)) 57 #define GO_PLUGIN_SERVICE_GET_CLASS(o) GO_PLUGIN_SERVICE_CLASS (G_OBJECT_GET_CLASS (o)) 58 59 typedef struct { 60 GOPluginServiceClass plugin_service_class; 61 GHashTable *pending; /* has service instances by type names */ 62 } GOPluginServiceGObjectLoaderClass; 63 64 struct _GOPluginServiceGObjectLoader { 65 GOPluginService plugin_service; 66 }; 67 68 #define GO_PLUGIN_SERVICE_GOBJECT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GO_TYPE_PLUGIN_SERVICE, GOPluginServiceGObjectLoaderClass)) 69 #define GO_PLUGIN_SERVICE_GOBJECT_LOADER_GET_CLASS(o) GO_PLUGIN_SERVICE_GOBJECT_LOADER_CLASS (G_OBJECT_GET_CLASS (o)) 70 71 typedef struct { 72 GOPluginServiceClass plugin_service_class; 73 } GOPluginServiceSimpleClass; 74 75 struct _GOPluginServiceSimple { 76 GOPluginService plugin_service; 77 }; 78 79 G_END_DECLS 80 81 #endif /* GO_PLUGIN_SERVICE_IMPL_H */ 82 83