Geany  dev
Functions | Variables
pluginsymbols.c File Reference

Symbols declared from within plugins. More...

Functions

void plugin_cleanup ()
 Called before unloading the plugin. More...
 
GtkWidget * plugin_configure (GtkDialog *dialog)
 Called before showing the plugin preferences dialog for multiple plugins. More...
 
void plugin_configure_single (GtkWidget *parent)
 Called when a plugin should show a preferences dialog, if plugin_configure() has not been implemented. More...
 
void plugin_help ()
 Called whenever the plugin should show its documentation (if any). More...
 
void plugin_init (GeanyData *data)
 Called after loading the plugin. More...
 
void plugin_set_info (PluginInfo *info)
 Use the PLUGIN_SET_INFO() macro to define it. More...
 
gint plugin_version_check (gint)
 Use the PLUGIN_VERSION_CHECK() macro instead. More...
 

Variables

const GeanyDatageany_data
 Geany owned data pointers. More...
 
const GeanyFunctionsgeany_functions
 Geany owned function pointers, split into groups. More...
 
const GeanyPlugingeany_plugin
 Basic information for the plugin and identification. More...
 
PluginCallback plugin_callbacks []
 An array for connecting GeanyObject events, which should be terminated with {NULL, NULL, FALSE, NULL}. More...
 
PluginFieldsplugin_fields
 
const PluginInfoplugin_info
 
KeyBindingGroup * plugin_key_group
 Plugins must use the PLUGIN_KEY_GROUP() macro to define it. More...
 

Detailed Description

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 plugindata.h.

Function Documentation

void plugin_cleanup ( )

Called before unloading the plugin.

Required for normal plugins - it should undo everything done in plugin_init() - e.g. destroy menu items, free memory.

GtkWidget* plugin_configure ( GtkDialog *  dialog)

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.

Parameters
dialogThe plugin preferences dialog widget - this should only be used to connect the "response" signal. If settings should be read from the dialog, the reponse will be either GTK_RESPONSE_OK or GTK_RESPONSE_APPLY.
Returns
A container widget holding preference widgets.
Note
Using Stash can make implementing preferences easier.
See Also
plugin_configure_single().
void plugin_configure_single ( GtkWidget *  parent)

Called when a plugin should show a preferences dialog, if plugin_configure() has not been implemented.

Warning
It's better to implement plugin_configure() instead, but this is simpler. This does not integrate as well with the multiple-plugin dialog.
Parameters
parentPass this as the parent widget if showing a dialog.
See Also
plugin_configure().
void plugin_help ( )

Called whenever the plugin should show its documentation (if any).

This may open a dialog, a browser with a website or a local installed HTML help file(see utils_open_browser()) or something else. Can be omitted when not needed.

void plugin_init ( GeanyData data)

Called after loading the plugin.

Parameters
dataThe same as geany_data.
void plugin_set_info ( PluginInfo info)

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.

Parameters
infoThe data struct which should be initialized by this function.
gint plugin_version_check ( gint  )

Use the PLUGIN_VERSION_CHECK() macro instead.

Required by Geany.

Returns
.

Variable Documentation

const GeanyData* geany_data

Geany owned data pointers.

Example: assert(geany_data->app->configdir != NULL);

const GeanyFunctions* geany_functions

Geany owned function pointers, split into groups.

Example:

#include "geanyfunctions.h"
...
document_new_file(NULL, NULL, NULL);

This is equivalent of geany_functions->p_document->document_new_file(NULL, NULL, NULL);

const GeanyPlugin* geany_plugin

Basic information for the plugin and identification.

PluginCallback plugin_callbacks[]

An array for connecting GeanyObject events, which should be terminated with {NULL, NULL, FALSE, NULL}.

See Signal documentation .

See Also
plugin_signal_connect().
PluginFields* plugin_fields
Deprecated:
Use ui_add_document_sensitive() instead.

Plugin owned fields, including flags.

const PluginInfo* plugin_info
Deprecated:
Use GeanyPlugin::info instead.

Basic information about a plugin, which is set in plugin_set_info().

KeyBindingGroup* plugin_key_group

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.