Kaydet (Commit) 7261742f authored tarafından Matthew Brush's avatar Matthew Brush Kaydeden (comit) Matthew Brush

Allow plugins to get the data they set

üst a108f916
......@@ -59,7 +59,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
#define GEANY_API_VERSION 233
#define GEANY_API_VERSION 234
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
......@@ -315,6 +315,7 @@ gboolean geany_plugin_register(GeanyPlugin *plugin, gint api_version,
gboolean geany_plugin_register_full(GeanyPlugin *plugin, gint api_version,
gint min_api_version, gint abi_version,
gpointer data, GDestroyNotify free_func);
gpointer geany_plugin_get_data(const GeanyPlugin *plugin);
void geany_plugin_set_data(GeanyPlugin *plugin, gpointer data, GDestroyNotify free_func);
/** Convenience macro to register a plugin.
......
......@@ -570,6 +570,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
}
/** Get the additional data that corresponds to the plugin.
*
* @param plugin The plugin provided by Geany
* @return The data corresponding to the plugin or @c NULL if none set.
*
* @since 1.32 (API 234)
*
* @see geany_plugin_set_data()
*/
gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);
return plugin->priv->cb_data;
}
/** Add additional data that corresponds to the plugin.
*
* @p pdata is the pointer going to be passed to the individual plugin callbacks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment