Geany dev
Functions | Variables
pluginsymbols.c File Reference

Symbols declared from within plugins, all of this is deprecated. 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 abi)
 Use the PLUGIN_VERSION_CHECK() macro instead. More...
 

Variables

const GeanyDatageany_data
 Geany owned data pointers. More...
 
const GeanyFunctions * geany_functions
 Geany owned function pointers, split into groups. More...
 
const GeanyPlugingeany_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}. More...
 
PluginFields * plugin_fields
 Plugin owned fields, including flags. More...
 
const PluginInfoplugin_info
 Basic information about a plugin, which is set in plugin_set_info(). More...
 
KeyBindingGroup * plugin_key_group
 Plugins must use the PLUGIN_KEY_GROUP() macro to define it. More...
 

Detailed Description

Symbols declared from within plugins, all of this is deprecated.

Deprecated:
This is the legacy way of making plugins for Geany. Refer to Plugin HowTo for the reworked process and Porting guide from legacy entry points to the current ones to learn how to port your plugin to that new world. Meanwhile Geany will still load plugins programmed against this interface (even the items that are marked deprecated individually such as plugin_fields).

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

◆ plugin_cleanup()

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.

◆ plugin_configure()

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 response will be either GTK_RESPONSE_OK or GTK_RESPONSE_APPLY.
Returns
(transfer: floating) A container widget holding preference widgets.
Note
Using Stash can make implementing preferences easier.
See also
plugin_configure_single().

◆ 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().

◆ plugin_help()

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.

◆ plugin_init()

void plugin_init ( GeanyData data)

Called after loading the plugin.

Parameters
dataThe same as geany_data.

◆ plugin_set_info()

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.

◆ plugin_version_check()

gint plugin_version_check ( gint  abi)

Use the PLUGIN_VERSION_CHECK() macro instead.

Required by Geany.

Parameters
abiABI version Geany was compiled with
Returns
The API version the plugin was compiled with, or -1 if the plugin is incompatible.

Variable Documentation

◆ geany_data

const GeanyData* geany_data

Geany owned data pointers.

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

◆ geany_functions

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);

◆ plugin_callbacks

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().

◆ plugin_fields

PluginFields* plugin_fields

Plugin owned fields, including flags.

Deprecated:
Use ui_add_document_sensitive() instead.

◆ plugin_info

const PluginInfo* plugin_info

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

Deprecated:
Use GeanyPlugin::info instead.

◆ plugin_key_group

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.