Bump API version for new plugin entry points (oops)
[geany-mirror.git] / src / pluginprivate.h
blob74a6a0615d96f2529841b7f53410cfda4275fdc7
1 /*
2 * pluginprivate.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2009-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
5 * Copyright 2009-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef GEANY_PLUGIN_PRIVATE_H
24 #define GEANY_PLUGIN_PRIVATE_H 1
26 #include "plugindata.h"
27 #include "ui_utils.h" /* GeanyAutoSeparator */
28 #include "keybindings.h" /* GeanyKeyGroup */
30 #include "gtkcompat.h"
33 G_BEGIN_DECLS
35 typedef struct SignalConnection
37 GObject *object;
38 gulong handler_id;
40 SignalConnection;
42 typedef enum _LoadedFlags {
43 LOADED_OK = 0x01,
44 IS_LEGACY = 0x02,
45 LOAD_DATA = 0x04,
47 LoadedFlags;
49 typedef struct GeanyPluginPrivate
51 GModule *module;
52 gchar *filename; /* plugin filename (/path/libname.so) */
53 PluginInfo info; /* plugin name, description, etc */
54 GeanyPlugin public; /* fields the plugin can read */
56 GeanyPluginFuncs cbs; /* Callbacks set by geany_plugin_register() */
57 void (*configure_single) (GtkWidget *parent); /* plugin configure dialog, optional and deprecated */
59 /* extra stuff */
60 PluginFields fields;
61 GeanyKeyGroup *key_group;
62 GeanyAutoSeparator toolbar_separator;
63 GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
64 GList *sources; /* GSources to destroy when unloading */
66 gpointer cb_data; /* user data passed back to functions in GeanyPluginFuncs */
67 GDestroyNotify cb_data_destroy; /* called when the plugin is unloaded, for cb_data */
68 LoadedFlags flags; /* bit-or of LoadedFlags */
70 GeanyPluginPrivate;
72 #define PLUGIN_LOADED_OK(p) (((p)->flags & LOADED_OK) != 0)
73 #define PLUGIN_IS_LEGACY(p) (((p)->flags & IS_LEGACY) != 0)
74 #define PLUGIN_HAS_LOAD_DATA(p) (((p)->flags & LOAD_DATA) != 0)
76 typedef GeanyPluginPrivate Plugin; /* shorter alias */
79 void plugin_watch_object(Plugin *plugin, gpointer object);
81 G_END_DECLS
83 #endif /* GEANY_PLUGIN_PRIVATE_H */