diff options
author | Gary Kramlich <grim@reaperworld.com> | 2021-05-29 03:20:21 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2021-05-29 03:20:21 -0500 |
commit | e79a1259463660e1be0ae33b734df9f156310981 (patch) | |
tree | 7e49766408ab4085189290011a1af854ad3a114e /finch/plugins | |
parent | 7c4a0e959d54b8f72decb791534fb44478ce03e0 (diff) | |
download | pidgin-e79a1259463660e1be0ae33b734df9f156310981.tar.gz |
Convert the Finch plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Testing Done:
Compile only
Reviewed at https://reviews.imfreedom.org/r/681/
Diffstat (limited to 'finch/plugins')
-rw-r--r-- | finch/plugins/gntclipboard.c | 14 | ||||
-rw-r--r-- | finch/plugins/gntgf.c | 14 | ||||
-rw-r--r-- | finch/plugins/gnthistory.c | 13 | ||||
-rw-r--r-- | finch/plugins/gnttinyurl.c | 14 | ||||
-rw-r--r-- | finch/plugins/grouping.c | 13 | ||||
-rw-r--r-- | finch/plugins/lastlog.c | 15 |
6 files changed, 30 insertions, 53 deletions
diff --git a/finch/plugins/gntclipboard.c b/finch/plugins/gntclipboard.c index 8f6e8b0392..8257473061 100644 --- a/finch/plugins/gntclipboard.c +++ b/finch/plugins/gntclipboard.c @@ -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 @@ clipboard_changed(GntWM *wm, gchar *string) } #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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 @@ plugin_unload(PurplePlugin *plugin, GError **error) 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 diff --git a/finch/plugins/gntgf.c b/finch/plugins/gntgf.c index c0349eb4f4..f89ba4780d 100644 --- a/finch/plugins/gntgf.c +++ b/finch/plugins/gntgf.c @@ -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 @@ config_frame(void) 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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 @@ plugin_unload(PurplePlugin *plugin, GError **error) 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 diff --git a/finch/plugins/gnthistory.c b/finch/plugins/gnthistory.c index 3b76a66bf7..3ce368b6c3 100644 --- a/finch/plugins/gnthistory.c +++ b/finch/plugins/gnthistory.c @@ -181,9 +181,8 @@ static void history_prefs_cb(const char *name, PurplePrefType type, 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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 diff --git a/finch/plugins/gnttinyurl.c b/finch/plugins/gnttinyurl.c index cf0b17d8a1..2192f456bf 100644 --- a/finch/plugins/gnttinyurl.c +++ b/finch/plugins/gnttinyurl.c @@ -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 @@ get_plugin_pref_frame(PurplePlugin *plugin) { 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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 @@ plugin_unload(PurplePlugin *plugin, GError **error) 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 diff --git a/finch/plugins/grouping.c b/finch/plugins/grouping.c index 06b07ccda7..1c9583a111 100644 --- a/finch/plugins/grouping.c +++ b/finch/plugins/grouping.c @@ -341,9 +341,8 @@ static FinchBlistManager nested_group = .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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 @@ plugin_unload(PurplePlugin *plugin, GError **error) return TRUE; } -PURPLE_PLUGIN_INIT(grouping, plugin_query, plugin_load, plugin_unload); +GPLUGIN_NATIVE_PLUGIN_DECLARE(grouping) diff --git a/finch/plugins/lastlog.c b/finch/plugins/lastlog.c index a400b480d9..6180f9dbde 100644 --- a/finch/plugins/lastlog.c +++ b/finch/plugins/lastlog.c @@ -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 @@ lastlog_cb(PurpleConversation *conv, const char *cmd, char **args, char **error, 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 @@ plugin_query(GError **error) } 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 @@ plugin_load(PurplePlugin *plugin, GError **error) } 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 |