Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE

Sat, 29 May 2021 03:19:13 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sat, 29 May 2021 03:19:13 -0500
changeset 40894
80d9d7a73a60
parent 40893
0131c0786803
child 40895
9406fe45ca7b

Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE

Testing Done:
Compiled and verified that the plugins that build by default showed up in the plugins window.

Reviewed at https://reviews.imfreedom.org/r/680/

pidgin/pidginplugininfo.c file | annotate | diff | comparison | revisions
pidgin/pidginplugininfo.h file | annotate | diff | comparison | revisions
pidgin/plugins/disco/xmppdisco.c file | annotate | diff | comparison | revisions
pidgin/plugins/gestures/gestures.c file | annotate | diff | comparison | revisions
pidgin/plugins/gtkbuddynote.c file | annotate | diff | comparison | revisions
pidgin/plugins/iconaway.c file | annotate | diff | comparison | revisions
pidgin/plugins/notify.c file | annotate | diff | comparison | revisions
pidgin/plugins/relnot.c file | annotate | diff | comparison | revisions
pidgin/plugins/spellchk.c file | annotate | diff | comparison | revisions
pidgin/plugins/unity.c file | annotate | diff | comparison | revisions
pidgin/plugins/xmppconsole/xmppconsole.c file | annotate | diff | comparison | revisions
--- a/pidgin/pidginplugininfo.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/pidginplugininfo.c	Sat May 29 03:19:13 2021 -0500
@@ -42,7 +42,7 @@
 /******************************************************************************
  * API
  *****************************************************************************/
-PidginPluginInfo *
+GPluginPluginInfo *
 pidgin_plugin_info_new(const char *first_property, ...)
 {
 	GObject *info;
@@ -60,5 +60,5 @@
 
 	g_object_set(info, "ui-requirement", PIDGIN_UI, NULL);
 
-	return PIDGIN_PLUGIN_INFO(info);
+	return GPLUGIN_PLUGIN_INFO(info);
 }
--- a/pidgin/pidginplugininfo.h	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/pidginplugininfo.h	Sat May 29 03:19:13 2021 -0500
@@ -28,6 +28,8 @@
 
 #include <gtk/gtk.h>
 
+#include <gplugin.h>
+
 #include <purple.h>
 
 G_BEGIN_DECLS
@@ -57,8 +59,7 @@
  *
  * Since: 3.0.0
  */
-PidginPluginInfo *pidgin_plugin_info_new(const char *first_property, ...)
-                  G_GNUC_NULL_TERMINATED;
+GPluginPluginInfo *pidgin_plugin_info_new(const char *first_property, ...) G_GNUC_NULL_TERMINATED;
 
 G_END_DECLS
 
--- a/pidgin/plugins/disco/xmppdisco.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/disco/xmppdisco.c	Sat May 29 03:19:13 2021 -0500
@@ -611,8 +611,8 @@
 	g_hash_table_foreach_remove(iq_callbacks, remove_iq_callbacks_by_pc, pc);
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+xmpp_disco_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Paul Aurich <paul@darkrain42.org>",
@@ -636,7 +636,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+xmpp_disco_load(GPluginPlugin *plugin, GError **error)
 {
 	PurpleProtocol *xmpp_protocol;
 	PurpleProtocolManager *manager;
@@ -662,7 +662,7 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+xmpp_disco_unload(GPluginPlugin *plugin, GError **error)
 {
 	g_hash_table_destroy(iq_callbacks);
 	iq_callbacks = NULL;
@@ -673,4 +673,4 @@
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(xmppdisco, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(xmpp_disco)
--- a/pidgin/plugins/gestures/gestures.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/gestures/gestures.c	Sat May 29 03:19:13 2021 -0500
@@ -207,8 +207,8 @@
 	return ret;
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+gestures_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Christian Hammond <chipx86@gnupdate.org>",
@@ -240,7 +240,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+gestures_load(GPluginPlugin *plugin, GError **error)
 {
 	PurpleConversation *conv;
 	GList *l;
@@ -272,7 +272,7 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+gestures_unload(GPluginPlugin *plugin, GError **error)
 {
 	PurpleConversation *conv;
 	PidginConversation *gtkconv;
@@ -293,4 +293,4 @@
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(gestures, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(gestures)
--- a/pidgin/plugins/gtkbuddynote.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/gtkbuddynote.c	Sat May 29 03:19:13 2021 -0500
@@ -41,8 +41,8 @@
 	}
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+gtk_buddy_note_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Etan Reisner <deryni@pidgin.im>",
@@ -70,7 +70,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+gtk_buddy_note_load(GPluginPlugin *plugin, GError **error)
 {
 	purple_signal_connect(pidgin_blist_get_handle(), "drawing-tooltip",
 	                      plugin, PURPLE_CALLBACK(append_to_tooltip), NULL);
@@ -78,9 +78,9 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+gtk_buddy_note_unload(GPluginPlugin *plugin, GError **error)
 {
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(gtkbuddynote, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(gtk_buddy_note)
--- a/pidgin/plugins/iconaway.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/iconaway.c	Sat May 29 03:19:13 2021 -0500
@@ -54,8 +54,8 @@
  *  EXPORTED FUNCTIONS
  */
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+icon_away_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Eric Warmenhoven <eric@warmenhoven.org>",
@@ -79,7 +79,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+icon_away_load(GPluginPlugin *plugin, GError **error)
 {
 	purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
 						plugin, PURPLE_CALLBACK(iconify_windows), NULL);
@@ -88,9 +88,9 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+icon_away_unload(GPluginPlugin *plugin, GError **error)
 {
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(iconaway, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(icon_away)
\ No newline at end of file
--- a/pidgin/plugins/notify.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/notify.c	Sat May 29 03:19:13 2021 -0500
@@ -869,8 +869,8 @@
 	return ret;
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+notify_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Etan Reisner <deryni@eden.rutgers.edu>",
@@ -896,7 +896,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+notify_load(GPluginPlugin *plugin, GError **error)
 {
 	GList *convs = purple_conversations_get_all();
 	void *conv_handle = purple_conversations_get_handle();
@@ -959,7 +959,7 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+notify_unload(GPluginPlugin *plugin, GError **error)
 {
 	GList *convs = purple_conversations_get_all();
 
@@ -975,4 +975,4 @@
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(notify, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(notify)
\ No newline at end of file
--- a/pidgin/plugins/relnot.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/relnot.c	Sat May 29 03:19:13 2021 -0500
@@ -125,8 +125,8 @@
 /**************************************************************************
  * Plugin stuff
  **************************************************************************/
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+relnot_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Nathan Walp <faceprint@faceprint.com>",
@@ -149,7 +149,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+relnot_load(GPluginPlugin *plugin, GError **error)
 {
 	purple_prefs_add_none("/plugins/gtk/relnot");
 	purple_prefs_add_int("/plugins/gtk/relnot/last_check", 0);
@@ -167,11 +167,11 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+relnot_unload(GPluginPlugin *plugin, GError **error)
 {
 	soup_session_abort(session);
 	g_clear_object(&session);
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(relnot, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(relnot)
--- a/pidgin/plugins/spellchk.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/spellchk.c	Sat May 29 03:19:13 2021 -0500
@@ -2266,8 +2266,8 @@
  *  EXPORTED FUNCTIONS
  */
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+spell_check_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Eric Warmenhoven <eric@warmenhoven.org>",
@@ -2290,7 +2290,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+spell_check_load(GPluginPlugin *plugin, GError **error)
 {
 	void *conv_handle = purple_conversations_get_handle();
 	GList *convs;
@@ -2317,7 +2317,7 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+spell_check_unload(GPluginPlugin *plugin, GError **error)
 {
 	GList *convs;
 
@@ -2334,4 +2334,4 @@
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(spellcheck, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(spell_check)
--- a/pidgin/plugins/unity.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/unity.c	Sat May 29 03:19:13 2021 -0500
@@ -499,8 +499,8 @@
 	return ret;
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+unity_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Ankit Vani <a@nevitus.org>",
@@ -524,8 +524,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
-{
+unity_load(GPluginPlugin *plugin, GError **error) {
 	GList *convs = purple_conversations_get_all();
 	PurpleSavedStatus *saved_status;
 	void *conv_handle = purple_conversations_get_handle();
@@ -583,8 +582,7 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
-{
+unity_unload(GPluginPlugin *plugin, GError **error) {
 	GList *convs = purple_conversations_get_all();
 	while (convs) {
 		PurpleConversation *conv = (PurpleConversation *)convs->data;
@@ -592,7 +590,7 @@
 		detach_signals(conv);
 		convs = convs->next;
 	}
-	
+
 	unity_launcher_entry_set_count_visible(launcher, FALSE);
 	messaging_menu_app_unregister(mmapp);
 
@@ -601,4 +599,4 @@
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(unity, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(unity)
--- a/pidgin/plugins/xmppconsole/xmppconsole.c	Sat May 29 03:17:29 2021 -0500
+++ b/pidgin/plugins/xmppconsole/xmppconsole.c	Sat May 29 03:19:13 2021 -0500
@@ -701,8 +701,8 @@
 	return l;
 }
 
-static PidginPluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+xmpp_console_query(GError **error)
 {
 	const gchar * const authors[] = {
 		"Sean Egan <seanegan@gmail.com>",
@@ -726,7 +726,7 @@
 }
 
 static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+xmpp_console_load(GPluginPlugin *plugin, GError **error)
 {
 	int i;
 	gboolean any_registered = FALSE;
@@ -769,11 +769,11 @@
 }
 
 static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+xmpp_console_unload(GPluginPlugin *plugin, GError **error)
 {
 	if (console)
 		gtk_widget_destroy(console->window);
 	return TRUE;
 }
 
-PURPLE_PLUGIN_INIT(xmppconsole, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(xmpp_console)

mercurial