Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: GitHub noreply@github.com Date: Sun, 14 Apr 2019 16:55:29 UTC Commit: 32a36e96e3c5011a1031ca2b8172ff6fcc764e45 https://github.com/geany/geany-plugins/commit/32a36e96e3c5011a1031ca2b8172ff...
Log Message: ----------- Merge pull request #701 from LarsGit223/automark-newapi
automark: use new plugin API
Modified Paths: -------------- automark/src/automark.c
Modified: automark/src/automark.c 52 lines changed, 37 insertions(+), 15 deletions(-) =================================================================== @@ -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 <rpg89(at)post(dot)ru>")
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 <rpg89(at)post(dot)ru>"; + + /* 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, 226); +}
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).