Geany dev
|
This file defines an interface allowing plugins to take over some of the core functionality provided by Geany: autocompletion, calltips, symbol goto, and types highlighting inside document. More...
Data Structures | |
struct | PluginExtension |
Structure serving as an interface between plugins and Geany allowing plugins to inform Geany about what features they provide and allowing Geany to delegate its functionality to the plugins. More... | |
Functions | |
gboolean | plugin_extension_autocomplete_provided (GeanyDocument *doc, PluginExtension *ext) |
Plugins can call this function to check whether, based on the extensions registered and the provided extension priorities, the extension passed in the ext parameter is used for autocompletion. More... | |
gboolean | plugin_extension_calltips_provided (GeanyDocument *doc, PluginExtension *ext) |
Checks whether the provided extension is used for showing calltips. More... | |
gboolean | plugin_extension_goto_provided (GeanyDocument *doc, PluginExtension *ext) |
Checks whether the provided extension is used for going to symbol definition/declaration. More... | |
void | plugin_extension_register (PluginExtension *extension, const gchar *ext_name, gint priority, gpointer data) |
Registers the provided extension in Geany. More... | |
gboolean | plugin_extension_symbol_highlight_provided (GeanyDocument *doc, PluginExtension *ext) |
Checks whether the provided extension is used for highlighting symbols in the document. More... | |
void | plugin_extension_unregister (PluginExtension *extension) |
Plugins are responsible for calling this function when they no longer provide the extension, at the latest in the plugin's cleanup() function. More... | |
This file defines an interface allowing plugins to take over some of the core functionality provided by Geany: autocompletion, calltips, symbol goto, and types highlighting inside document.
gboolean plugin_extension_autocomplete_provided | ( | GeanyDocument * | doc, |
PluginExtension * | ext | ||
) |
Plugins can call this function to check whether, based on the extensions registered and the provided extension priorities, the extension passed in the ext
parameter is used for autocompletion.
Plugins will typically call this function with their own PluginExtension
to check, if they get (or got) executed for autocompletion of the provided document. This is useful for various auxiliary functions such as cleanups after the function assigned to autocomplete_perform
is completed so plugins know they executed this function and do not have to store this information by some other means.
doc | Document for which the check is performed. |
ext | The extension for which the check is performed. |
TRUE
if autocompletion provided by the passed extension is used, FALSE
otherwise.gboolean plugin_extension_calltips_provided | ( | GeanyDocument * | doc, |
PluginExtension * | ext | ||
) |
Checks whether the provided extension is used for showing calltips.
gboolean plugin_extension_goto_provided | ( | GeanyDocument * | doc, |
PluginExtension * | ext | ||
) |
Checks whether the provided extension is used for going to symbol definition/declaration.
void plugin_extension_register | ( | PluginExtension * | extension, |
const gchar * | ext_name, | ||
gint | priority, | ||
gpointer | data | ||
) |
Registers the provided extension in Geany.
There can be multiple extensions registered in Geany - these are sorted by the priority parameter. When executing functions assigned to the PluginExtension
members ending with _perform
, Geany goes through the registered extensions and executes the _perform()
function of the first extension for which the function assigned to the corresponding _provided
member returns TRUE
.
This function is typically called in the plugin's init()
function.
Plugins wishing to re-register themselves, e.g. with a different priority, should first unregister themselves using plugin_extension_unregister()
and call plugin_extension_register()
afterwards.
extension | A pointer to the PluginExtension structure to register. This pointer and the PluginExtension it points to have to remain valid until the extension is unregistered. All fields of the PluginExtension structure have to be fully initialized either to the NULL pointer or to a proper implementation. Usually, this structure is statically allocated which automatically zero-initializes uninitialized members as appropriate. |
ext_name | Human-readable name of the extension that can appear in the user interface. The string should be reasonably unique so extensions can be distinguished from each other. |
priority | Extension priority. The recommended values are:
|
data | User data passed to the functions from the PluginExtension struct. |
plugin_extension_unregister()
when they no longer provide the extension and when the plugin is unloaded.plugin_extension_unregister()
.gboolean plugin_extension_symbol_highlight_provided | ( | GeanyDocument * | doc, |
PluginExtension * | ext | ||
) |
Checks whether the provided extension is used for highlighting symbols in the document.
void plugin_extension_unregister | ( | PluginExtension * | extension | ) |
Plugins are responsible for calling this function when they no longer provide the extension, at the latest in the plugin's cleanup()
function.
extension | The PluginExtension structure pointer to unregister, as previously registered with plugin_extension_register() . |
plugin_extension_register()
.