geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pluginsymbols.c File Reference

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

Go to the source code of this file.

Functions

gint plugin_version_check (gint abi)
 Use the PLUGIN_VERSION_CHECK() macro instead. More...
 
void plugin_set_info (PluginInfo *info)
 Use the PLUGIN_SET_INFO() macro to define it. 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_init (GeanyData *data)
 Called after loading the plugin. More...
 
void plugin_cleanup ()
 Called before unloading the plugin. More...
 
void plugin_help ()
 Called whenever the plugin should show its documentation (if any). More...
 

Variables

const PluginInfoplugin_info
 Basic information about a plugin, which is set in plugin_set_info(). More...
 
const GeanyPlugingeany_plugin
 Basic information for the plugin and identification. More...
 
const GeanyDatageany_data
 Geany owned data pointers. More...
 
const GeanyFunctionsgeany_functions
 Geany owned function pointers, split into groups. More...
 
PluginFieldsplugin_fields
 Plugin owned fields, including flags. More...
 
PluginCallback plugin_callbacks []
 An array for connecting GeanyObject events, which should be terminated with {NULL, NULL, FALSE, NULL}. 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.

Definition in file pluginsymbols.c.

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.

Definition at line 773 of file export.c.

References main_menu_item.

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

Definition at line 1259 of file filebrowser.c.

References _, dialog, entry, fb_follow_path, fb_set_project_base_path, gtk_container_add(), gtk_widget_show_all(), hidden_file_extensions, hide_object_files, label, NULL, on_configure_response(), on_toggle_hidden(), open_cmd, pref_widgets, and show_hidden_files.

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

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

Definition at line 739 of file export.c.

References _, geany, gtk_container_add(), gtk_widget_show_all(), main_menu_item, NULL, on_menu_create_html_activate(), on_menu_create_latex_activate(), and ui_add_document_sensitive().

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

Definition at line 35 of file classbuilder.c.

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

Definition at line 32 of file classbuilder.c.

Variable Documentation

◆ geany_data

const GeanyData* geany_data

Geany owned data pointers.

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

Definition at line 59 of file pluginsymbols.c.

Referenced by demo_init(), item_activate(), and on_editor_notify().

◆ geany_functions

const GeanyFunctions* geany_functions

Geany owned function pointers, split into groups.

Example:

#include "geanyfunctions.h"
...
document_new_file(NULL, NULL, NULL);
#define NULL
Definition: rbtree.h:150

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

Definition at line 66 of file pluginsymbols.c.

◆ geany_plugin

const GeanyPlugin* geany_plugin

Basic information for the plugin and identification.

Definition at line 55 of file pluginsymbols.c.

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

Definition at line 75 of file pluginsymbols.c.

◆ plugin_fields

PluginFields* plugin_fields

Plugin owned fields, including flags.

Deprecated:
Use ui_add_document_sensitive() instead.

Definition at line 70 of file pluginsymbols.c.

Referenced by plugin_load().

◆ plugin_info

const PluginInfo* plugin_info

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

Deprecated:
Use GeanyPlugin::info instead.

Definition at line 52 of file pluginsymbols.c.

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

Definition at line 80 of file pluginsymbols.c.