Merge pull request #3865 from techee/none_crash
[geany-mirror.git] / src / pluginprivate.h
blob6642fc534f81fee4e05349bd68701ab3675c449b
1 /*
2 * pluginprivate.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2009 The Geany contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef GEANY_PLUGIN_PRIVATE_H
23 #define GEANY_PLUGIN_PRIVATE_H 1
25 #include "plugindata.h"
26 #include "ui_utils.h" /* GeanyAutoSeparator */
27 #include "keybindings.h" /* GeanyKeyGroup */
30 G_BEGIN_DECLS
32 typedef struct SignalConnection
34 GObject *object;
35 gulong handler_id;
37 SignalConnection;
39 typedef enum _LoadedFlags {
40 LOADED_OK = 0x01,
41 IS_LEGACY = 0x02,
42 LOAD_DATA = 0x04,
44 LoadedFlags;
46 typedef struct GeanyPluginPrivate Plugin; /* shorter alias */
48 typedef struct GeanyPluginPrivate
50 gchar *filename; /* plugin filename (/path/libname.so) */
51 PluginInfo info; /* plugin name, description, etc */
52 GeanyPlugin public; /* fields the plugin can read */
54 GeanyPluginFuncs cbs; /* Callbacks set by geany_plugin_register() */
55 void (*configure_single) (GtkWidget *parent); /* plugin configure dialog, optional and deprecated */
57 /* extra stuff */
58 GeanyKeyGroup *key_group;
59 GeanyAutoSeparator toolbar_separator;
60 GArray *signal_ids; /* SignalConnection's to disconnect when unloading */
61 GList *sources; /* GSources to destroy when unloading */
63 gpointer cb_data; /* user data passed back to functions in GeanyPluginFuncs */
64 GDestroyNotify cb_data_destroy; /* called when the plugin is unloaded, for cb_data */
65 LoadedFlags flags; /* bit-or of LoadedFlags */
67 /* proxy plugin support */
68 GeanyProxyFuncs proxy_cbs;
69 Plugin *proxy; /* The proxy that handles this plugin */
70 gpointer proxy_data; /* Data passed to the proxy hooks of above proxy, so
71 * this gives the proxy a pointer to each plugin */
72 gint proxied_count; /* count of active plugins this provides a proxy for
73 * (a count because of possibly nested proxies) */
75 GeanyPluginPrivate;
77 #define PLUGIN_LOADED_OK(p) (((p)->flags & LOADED_OK) != 0)
78 #define PLUGIN_IS_LEGACY(p) (((p)->flags & IS_LEGACY) != 0)
79 #define PLUGIN_HAS_LOAD_DATA(p) (((p)->flags & LOAD_DATA) != 0)
81 void plugin_watch_object(Plugin *plugin, gpointer object);
82 void plugin_make_resident(Plugin *plugin);
83 gpointer plugin_get_module_symbol(Plugin *plugin, const gchar *sym);
85 G_END_DECLS
87 #endif /* GEANY_PLUGIN_PRIVATE_H */