pluginsymbols.c 4.67 KB
Newer Older
1
/*
2
 *      pluginsymbols.c - this file is part of Geany, a fast and lightweight IDE
3
 *
4 5
 *      Copyright 2008-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
 *      Copyright 2008-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
6 7 8 9 10 11 12 13 14 15 16
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
Colomban Wendling's avatar
Colomban Wendling committed
17 18 19
 *      You should have received a copy of the GNU General Public License along
 *      with this program; if not, write to the Free Software Foundation, Inc.,
 *      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 21 22 23 24
 */

/* Note: this file is for Doxygen only. */

/**
25
 * @file pluginsymbols.c
26 27 28 29 30 31 32 33
 * Symbols declared from within plugins.
 *
 * Geany looks for these symbols (arrays, pointers and functions) when initializing
 * plugins. Some of them are optional, i.e. they can be omitted; others are required
 * and must be defined. Some symbols should only be declared using specific macros in
 * @link plugindata.h @endlink.
 */

34 35
/** Use the PLUGIN_VERSION_CHECK() macro instead. Required by Geany.
 * @return . */
36
gint plugin_version_check(gint);
37

38 39 40 41 42 43
/** Use the PLUGIN_SET_INFO() macro to define it. Required by Geany.
 * This function is called before the plugin is initialized, so Geany
 * can read the plugin's name.
 * @param info The data struct which should be initialized by this function. */
void plugin_set_info(PluginInfo *info);

44
/** @deprecated Use @ref GeanyPlugin.info instead.
Nick Treleaven's avatar
Nick Treleaven committed
45 46 47 48 49
 * Basic information about a plugin, which is set in plugin_set_info(). */
const PluginInfo *plugin_info;

/** Basic information for the plugin and identification. */
const GeanyPlugin *geany_plugin;
50

51 52
/** Geany owned data pointers.
 * Example: @c assert(geany_data->app->configdir != NULL); */
Nick Treleaven's avatar
Nick Treleaven committed
53
const GeanyData *geany_data;
54

55
/** Geany owned function pointers, split into groups.
56 57 58
 * Example: @code #include "geanyfunctions.h"
 * ...
 * document_new_file(NULL, NULL, NULL); @endcode
59
 * This is equivalent of @c geany_functions->p_document->document_new_file(NULL, NULL, NULL); */
Nick Treleaven's avatar
Nick Treleaven committed
60
const GeanyFunctions *geany_functions;
61

62 63
/** @deprecated Use @ref ui_add_document_sensitive() instead.
 * Plugin owned fields, including flags. */
Nick Treleaven's avatar
Nick Treleaven committed
64
PluginFields *plugin_fields;
65 66

/** An array for connecting GeanyObject events, which should be terminated with
67
 * @c {NULL, NULL, FALSE, NULL}. See @link pluginsignals.c Signal documentation @endlink.
68
 * @see plugin_signal_connect(). */
69
PluginCallback plugin_callbacks[];
70

71 72 73 74
/** Plugins must use the PLUGIN_KEY_GROUP() macro to define it.
 * To setup a variable number of keybindings, e.g. based on the
 * plugin's configuration file settings, use plugin_set_key_group() instead. */
KeyBindingGroup *plugin_key_group;
75 76


77 78 79
/** Called before showing the plugin preferences dialog for multiple plugins.
 * Can be omitted when not needed.
 * The dialog will show all plugins that support this symbol together.
80 81
 * @param dialog The plugin preferences dialog widget - this should only be used to
 * connect the @c "response" signal. If settings should be read from the dialog, the
82
 * response will be either @c GTK_RESPONSE_OK or @c GTK_RESPONSE_APPLY.
83
 * @return A container widget holding preference widgets.
84
 * @note Using @link stash.h Stash @endlink can make implementing preferences easier.
85 86 87 88 89
 * @see plugin_configure_single(). */
GtkWidget *plugin_configure(GtkDialog *dialog);

/** Called when a plugin should show a preferences dialog, if plugin_configure() has not been
 * implemented.
90 91
 * @warning It's better to implement plugin_configure() instead, but this is simpler.
 * This does not integrate as well with the multiple-plugin dialog.
92 93 94
 * @param parent Pass this as the parent widget if showing a dialog.
 * @see plugin_configure(). */
void plugin_configure_single(GtkWidget *parent);
95 96 97

/** Called after loading the plugin.
 * @param data The same as #geany_data. */
98
void plugin_init(GeanyData *data);
99 100

/** Called before unloading the plugin. Required for normal plugins - it should undo
101 102
 * everything done in plugin_init() - e.g. destroy menu items, free memory. */
void plugin_cleanup();
103

104
/** Called whenever the plugin should show its documentation (if any). This may open a dialog,
105
 * a browser with a website or a local installed HTML help file(see utils_open_browser())
106 107 108 109
 * or something else.
 * Can be omitted when not needed. */
void plugin_help();