Sat, 29 May 2021 03:20:21 -0500
Convert the Finch plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Testing Done:
Compile only
Reviewed at https://reviews.imfreedom.org/r/681/
--- a/finch/gntplugin.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/gntplugin.c Sat May 29 03:20:21 2021 -0500 @@ -128,7 +128,7 @@ G_PARAM_STATIC_STRINGS)); } -FinchPluginInfo * +GPluginPluginInfo * finch_plugin_info_new(const char *first_property, ...) { GObject *info; @@ -145,7 +145,7 @@ g_object_set(info, "ui-requirement", FINCH_UI, NULL); - return FINCH_PLUGIN_INFO(info); + return GPLUGIN_PLUGIN_INFO(info); } static void
--- a/finch/gntplugin.h Sat May 29 03:19:13 2021 -0500 +++ b/finch/gntplugin.h Sat May 29 03:20:21 2021 -0500 @@ -107,8 +107,7 @@ * * Returns: A new #FinchPluginInfo instance. */ -FinchPluginInfo *finch_plugin_info_new(const char *first_property, ...) - G_GNUC_NULL_TERMINATED; +GPluginPluginInfo *finch_plugin_info_new(const char *first_property, ...) G_GNUC_NULL_TERMINATED; /********************************************************************** * GNT Plugins API
--- a/finch/plugins/gntclipboard.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/gntclipboard.c Sat May 29 03:20:21 2021 -0500 @@ -21,7 +21,6 @@ #define PLUGIN_ID "gntclipboard" #define PLUGIN_DOMAIN (g_quark_from_static_string(PLUGIN_ID)) -#define PLUGIN_STATIC_NAME GntClipboard #ifdef HAVE_X11 #include <X11/Xlib.h> @@ -102,9 +101,8 @@ } #endif -static FinchPluginInfo * -plugin_query(GError **error) -{ +static GPluginPluginInfo * +gnt_clipboard_query(GError **error) { const gchar * const authors[] = { "Richard Nelson <wabz@whatsbeef.net>", NULL @@ -126,8 +124,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +gnt_clipboard_load(GPluginPlugin *plugin, GError **error) { #ifdef HAVE_X11 if (!XOpenDisplay(NULL)) { purple_debug_warning("gntclipboard", "Couldn't find X display\n"); @@ -151,8 +148,7 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +gnt_clipboard_unload(GPluginPlugin *plugin, GError **error) { #ifdef HAVE_X11 if (child) { kill(child, SIGTERM); @@ -163,4 +159,4 @@ return TRUE; } -PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(gnt_clipboard) \ No newline at end of file
--- a/finch/plugins/gntgf.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/gntgf.c Sat May 29 03:20:21 2021 -0500 @@ -18,8 +18,6 @@ #include NCURSES_HEADER -#define PLUGIN_STATIC_NAME GntGf - #define PREFS_PREFIX "/plugins/gnt/gntgf" #define PREFS_EVENT PREFS_PREFIX "/events" #define PREFS_EVENT_SIGNONF PREFS_EVENT "/signonf" @@ -321,8 +319,8 @@ return window; } -static FinchPluginInfo * -plugin_query(GError **error) +static GPluginPluginInfo * +gnt_gf_query(GError **error) { const gchar * const authors[] = { "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", @@ -345,8 +343,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +gnt_gf_load(GPluginPlugin *plugin, GError **error) { purple_prefs_add_none("/plugins"); purple_prefs_add_none("/plugins/gnt"); @@ -379,8 +376,7 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +gnt_gf_unload(GPluginPlugin *plugin, GError **error) { while (toasters) { GntToast *toast = toasters->data; @@ -389,4 +385,4 @@ return TRUE; } -PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(gnt_gf) \ No newline at end of file
--- a/finch/plugins/gnthistory.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/gnthistory.c Sat May 29 03:20:21 2021 -0500 @@ -181,9 +181,8 @@ history_prefs_check((PurplePlugin *)data); } -static FinchPluginInfo * -plugin_query(GError **error) -{ +static GPluginPluginInfo * +gnt_history_query(GError **error) { const gchar * const authors[] = { "Sean Egan <seanegan@gmail.com>", "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", @@ -208,8 +207,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +gnt_history_load(GPluginPlugin *plugin, GError **error) { purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(historize), NULL); @@ -225,9 +223,8 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +gnt_history_unload(GPluginPlugin *plugin, GError **error) { return TRUE; } -PURPLE_PLUGIN_INIT(gnthistory, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(gnt_history) \ No newline at end of file
--- a/finch/plugins/gnttinyurl.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/gnttinyurl.c Sat May 29 03:20:21 2021 -0500 @@ -21,7 +21,6 @@ #include <glib.h> #include <libsoup/soup.h> -#define PLUGIN_STATIC_NAME TinyURL #define PREFS_BASE "/plugins/gnt/tinyurl" #define PREF_LENGTH PREFS_BASE "/length" #define PREF_URL PREFS_BASE "/url" @@ -453,9 +452,8 @@ return frame; } -static FinchPluginInfo * -plugin_query(GError **error) -{ +static GPluginPluginInfo * +tiny_url_query(GError **error) { const gchar * const authors[] = { "Richard Nelson <wabz@whatsbeef.net>", NULL @@ -478,8 +476,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +tiny_url_load(GPluginPlugin *plugin, GError **error) { PurpleNotifyUiOps *ops = purple_notify_get_ui_ops(); session = soup_session_new(); @@ -514,8 +511,7 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +tiny_url_unload(GPluginPlugin *plugin, GError **error) { PurpleNotifyUiOps *ops = purple_notify_get_ui_ops(); if (ops->notify_uri == tinyurl_notify_uri) ops->notify_uri = g_object_get_data(G_OBJECT(plugin), "notify-uri"); @@ -529,4 +525,4 @@ return TRUE; } -PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(tiny_url) \ No newline at end of file
--- a/finch/plugins/grouping.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/grouping.c Sat May 29 03:20:21 2021 -0500 @@ -341,9 +341,8 @@ .can_add_node = nested_group_can_add_node, }; -static FinchPluginInfo * -plugin_query(GError **error) -{ +static GPluginPluginInfo * +grouping_query(GError **error) { const gchar * const authors[] = { "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", NULL @@ -364,8 +363,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +grouping_load(GPluginPlugin *plugin, GError **error) { finch_grouping_node_register_type(G_TYPE_MODULE(plugin)); default_manager = finch_blist_manager_find("default"); @@ -381,8 +379,7 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +grouping_unload(GPluginPlugin *plugin, GError **error) { finch_blist_uninstall_manager(&on_offline); finch_blist_uninstall_manager(&meebo_group); finch_blist_uninstall_manager(&no_group); @@ -394,4 +391,4 @@ return TRUE; } -PURPLE_PLUGIN_INIT(grouping, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(grouping)
--- a/finch/plugins/lastlog.c Sat May 29 03:19:13 2021 -0500 +++ b/finch/plugins/lastlog.c Sat May 29 03:20:21 2021 -0500 @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#define PLUGIN_STATIC_NAME GntLastlog - #include <glib/gi18n-lib.h> #include <purple.h> @@ -88,9 +86,8 @@ return PURPLE_CMD_RET_OK; } -static FinchPluginInfo * -plugin_query(GError **error) -{ +static GPluginPluginInfo * +gnt_last_log_query(GError **error) { const gchar * const authors[] = { "Sadrul H Chowdhury <sadrul@users.sourceforge.net>", NULL @@ -111,8 +108,7 @@ } static gboolean -plugin_load(PurplePlugin *plugin, GError **error) -{ +gnt_last_log_load(GPluginPlugin *plugin, GError **error) { cmd = purple_cmd_register("lastlog", "s", PURPLE_CMD_P_DEFAULT, PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL, /* Translators: The "backlog" here refers to the the conversation buffer/history. */ @@ -121,10 +117,9 @@ } static gboolean -plugin_unload(PurplePlugin *plugin, GError **error) -{ +gnt_last_log_unload(GPluginPlugin *plugin, GError **error) { purple_cmd_unregister(cmd); return TRUE; } -PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(gnt_last_log) \ No newline at end of file