Add keybindings for "Project->New from Folder"
[geany-mirror.git] / doc / pluginsymbols.c
blob6c08b6d39ec0cc3e264e40047a3f1dd27fd6b004
1 /*
2 * pluginsymbols.c - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2008 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.
21 /* Note: this file is for Doxygen only. */
23 /**
24 * @file pluginsymbols.c
25 * Symbols declared from within plugins, all of this is <b>deprecated</b>.
27 * @deprecated This is the legacy way of making plugins for Geany. Refer to @ref howto for the
28 * reworked process and @ref legacy to learn how to port your plugin to that new world.
29 * Meanwhile Geany will still load plugins programmed against this interface (even the items that
30 * are marked deprecated individually such as @ref plugin_fields).
32 * Geany looks for these symbols (arrays, pointers and functions) when initializing
33 * plugins. Some of them are optional, i.e. they can be omitted; others are required
34 * and must be defined. Some symbols should only be declared using specific macros in
35 * @link plugindata.h @endlink.
38 /** Use the PLUGIN_VERSION_CHECK() macro instead. Required by Geany.
40 * @param abi ABI version Geany was compiled with
41 * @return The API version the plugin was compiled with, or -1 if the plugin is incompatible. */
42 gint plugin_version_check(gint abi);
44 /** Use the PLUGIN_SET_INFO() macro to define it. Required by Geany.
45 * This function is called before the plugin is initialized, so Geany
46 * can read the plugin's name.
47 * @param info The data struct which should be initialized by this function. */
48 void plugin_set_info(PluginInfo *info);
50 /** Basic information about a plugin, which is set in plugin_set_info().
51 * @deprecated Use @ref GeanyPlugin.info instead.*/
52 const PluginInfo *plugin_info;
54 /** Basic information for the plugin and identification. */
55 const GeanyPlugin *geany_plugin;
57 /** Geany owned data pointers.
58 * Example: @c assert(geany_data->app->configdir != NULL); */
59 const GeanyData *geany_data;
61 /** Geany owned function pointers, split into groups.
62 * Example: @code #include "geanyfunctions.h"
63 * ...
64 * document_new_file(NULL, NULL, NULL); @endcode
65 * This is equivalent of @c geany_functions->p_document->document_new_file(NULL, NULL, NULL); */
66 const GeanyFunctions *geany_functions;
68 /** Plugin owned fields, including flags.
69 * @deprecated Use @ref ui_add_document_sensitive() instead.*/
70 PluginFields *plugin_fields;
72 /** An array for connecting GeanyObject events, which should be terminated with
73 * @c {NULL, NULL, FALSE, NULL}. See @link pluginsignals.c Signal documentation @endlink.
74 * @see plugin_signal_connect(). */
75 PluginCallback plugin_callbacks[];
77 /** Plugins must use the PLUGIN_KEY_GROUP() macro to define it.
78 * To setup a variable number of keybindings, e.g. based on the
79 * plugin's configuration file settings, use plugin_set_key_group() instead. */
80 KeyBindingGroup *plugin_key_group;
83 /** Called before showing the plugin preferences dialog for multiple plugins.
84 * Can be omitted when not needed.
85 * The dialog will show all plugins that support this symbol together.
86 * @param dialog The plugin preferences dialog widget - this should only be used to
87 * connect the @c "response" signal. If settings should be read from the dialog, the
88 * response will be either @c GTK_RESPONSE_OK or @c GTK_RESPONSE_APPLY.
90 * @return @transfer{floating} A container widget holding preference widgets.
92 * @note Using @link stash.h Stash @endlink can make implementing preferences easier.
93 * @see plugin_configure_single(). */
94 GtkWidget *plugin_configure(GtkDialog *dialog);
96 /** Called when a plugin should show a preferences dialog, if plugin_configure() has not been
97 * implemented.
98 * @warning It's better to implement plugin_configure() instead, but this is simpler.
99 * This does not integrate as well with the multiple-plugin dialog.
100 * @param parent Pass this as the parent widget if showing a dialog.
101 * @see plugin_configure(). */
102 void plugin_configure_single(GtkWidget *parent);
104 /** Called after loading the plugin.
105 * @param data The same as #geany_data. */
106 void plugin_init(GeanyData *data);
108 /** Called before unloading the plugin. Required for normal plugins - it should undo
109 * everything done in plugin_init() - e.g. destroy menu items, free memory. */
110 void plugin_cleanup();
112 /** Called whenever the plugin should show its documentation (if any). This may open a dialog,
113 * a browser with a website or a local installed HTML help file (see utils_open_browser())
114 * or something else.
115 * Can be omitted when not needed. */
116 void plugin_help();