From 4f561c679b2342c3f56775c87b2b81959e737bb3 Mon Sep 17 00:00:00 2001 From: LarsDW223 Date: Sat, 24 Feb 2018 13:39:04 +0100 Subject: [PATCH 1/2] automark: use new plugin API --- automark/src/automark.c | 52 +++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/automark/src/automark.c b/automark/src/automark.c index add68672b..cbbb32224 100644 --- a/automark/src/automark.c +++ b/automark/src/automark.c @@ -40,14 +40,6 @@ GeanyPlugin *geany_plugin; GeanyData *geany_data; -PLUGIN_VERSION_CHECK(224) -PLUGIN_SET_TRANSLATABLE_INFO( - LOCALEDIR, - GETTEXT_PACKAGE, - _("Auto-mark"), - _("Auto-mark word under cursor"), - "0.1", - "Pavel Roschin ") static gint source_id; @@ -168,27 +160,57 @@ on_editor_notify( return FALSE; } -PluginCallback plugin_callbacks[] = +static PluginCallback plugin_automark_callbacks[] = { { "editor-notify", (GCallback) &on_editor_notify, FALSE, NULL }, { NULL, NULL, FALSE, NULL } }; -void -plugin_init(G_GNUC_UNUSED GeanyData *data) + +static gboolean +plugin_automark_init(GeanyPlugin *plugin, G_GNUC_UNUSED gpointer pdata) { + geany_plugin = plugin; + geany_data = plugin->geany_data; source_id = 0; + return TRUE; } -void -plugin_cleanup(void) + +static void +plugin_automark_cleanup(G_GNUC_UNUSED GeanyPlugin *plugin, G_GNUC_UNUSED gpointer pdata) { if (source_id) g_source_remove(source_id); } -void -plugin_help(void) + +static void +plugin_automark_help (G_GNUC_UNUSED GeanyPlugin *plugin, G_GNUC_UNUSED gpointer pdata) { utils_open_browser("http://plugins.geany.org/automark.html"); } + + +/* Load module */ +G_MODULE_EXPORT +void geany_load_module(GeanyPlugin *plugin) +{ + /* Setup translation */ + main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + + /* Set metadata */ + plugin->info->name = _("Auto-mark"); + plugin->info->description = _("Auto-mark word under cursor"); + plugin->info->version = "0.1"; + plugin->info->author = "Pavel Roschin "; + + /* Set functions */ + plugin->funcs->init = plugin_automark_init; + plugin->funcs->cleanup = plugin_automark_cleanup; + plugin->funcs->help = plugin_automark_help; + plugin->funcs->callbacks = plugin_automark_callbacks; + + /* Register! */ + GEANY_PLUGIN_REGISTER(plugin, 224); +} From 26bb62e955627659a6229694b7d2e918056600b0 Mon Sep 17 00:00:00 2001 From: Lars Paulsen Date: Mon, 18 Jun 2018 21:28:04 +0200 Subject: [PATCH 2/2] automark: new plugin API requires version 1.26 (226) --- automark/src/automark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automark/src/automark.c b/automark/src/automark.c index cbbb32224..c78df6f2a 100644 --- a/automark/src/automark.c +++ b/automark/src/automark.c @@ -212,5 +212,5 @@ void geany_load_module(GeanyPlugin *plugin) plugin->funcs->callbacks = plugin_automark_callbacks; /* Register! */ - GEANY_PLUGIN_REGISTER(plugin, 224); + GEANY_PLUGIN_REGISTER(plugin, 226); }