fixed dia_image_rgb_data() for non-alpha images
[dia.git] / lib / plug-ins.h
blobc3785295b76660de65b14ce636759d88f86e7883
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1999 Alexander Larsson
4 * plug-ins.h: plugin loading handling interfaces for dia
5 * Copyright (C) 2000 James Henstridge
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef PLUG_INS_H
23 #define PLUG_INS_H
25 #include <glib.h>
26 #include <gmodule.h>
27 #include "diatypes.h"
29 #define DIA_PLUGIN_API_VERSION 4
31 typedef enum {
32 DIA_PLUGIN_INIT_OK,
33 DIA_PLUGIN_INIT_ERROR
34 } PluginInitResult;
36 typedef PluginInitResult (*PluginInitFunc) (PluginInfo *info);
37 typedef gboolean (*PluginCanUnloadFunc) (PluginInfo *info);
38 typedef void (*PluginUnloadFunc) (PluginInfo *info);
40 /* functions for use by plugins ... */
42 gboolean dia_plugin_info_init(PluginInfo *info, gchar *name,
43 gchar *description,
44 PluginCanUnloadFunc can_unload_func,
45 PluginUnloadFunc unload_func);
47 gchar *dia_plugin_check_version(gint version);
50 /* functiosn for use by dia ... */
51 const gchar *dia_plugin_get_filename (PluginInfo *info);
52 const gchar *dia_plugin_get_name (PluginInfo *info);
53 const gchar *dia_plugin_get_description (PluginInfo *info);
54 const gpointer *dia_plugin_get_symbol (PluginInfo *info, const gchar *name);
56 gboolean dia_plugin_can_unload (PluginInfo *info);
57 gboolean dia_plugin_is_loaded (PluginInfo *info);
58 gboolean dia_plugin_get_inhibit_load (PluginInfo *info);
59 void dia_plugin_set_inhibit_load (PluginInfo *info, gboolean inhibit_load);
61 void dia_plugin_load (PluginInfo *info);
62 void dia_plugin_unload (PluginInfo *info);
64 void dia_register_plugin (const gchar *filename);
65 void dia_register_plugins_in_dir (const gchar *directory);
66 void dia_register_plugins (void);
67 void dia_register_builtin_plugin (PluginInitFunc init_func);
69 GList *dia_list_plugins(void);
71 void dia_pluginrc_write(void);
73 /* macro defining the version check that should be implemented by all
74 * plugins. */
75 #define DIA_PLUGIN_CHECK_INIT \
76 G_MODULE_EXPORT const gchar *g_module_check_init(GModule *gmodule); \
77 const gchar * \
78 g_module_check_init(GModule *gmodule) \
79 { \
80 return dia_plugin_check_version(DIA_PLUGIN_API_VERSION); \
83 /* prototype for plugin init function (should be implemented by plugin) */
84 G_MODULE_EXPORT PluginInitResult dia_plugin_init(PluginInfo *info);
86 #endif