/soc/2013/ankitkv/gobjectification: e7268aeb3b89: Renamed plugin...

Ankit Vani a at nevitus.org
Sun Oct 27 15:33:23 EDT 2013


Changeset: e7268aeb3b89d91574919b3a604cbe2c2d6f6275
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-10-28 00:02 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e7268aeb3b89

Description:

Renamed plugin info callback properties to end with "-cb", and their respective symbols.
- Renamed "preferences-frame" to "pref-frame-cb"
- Renamed "preferences-request" to "pref-request-cb"
- Renamed "get-actions" to "actions-cb"
- Renamed "finch-preferences-frame" to "finch-pref-frame-cb"
- Renamed "pidgin-config-frame" to "pidgin-config-frame-cb"

diffstat:

 ChangeLog.API                                  |   6 +-
 finch/gntblist.c                               |  10 +-
 finch/gntplugin.c                              |  38 +++++-----
 finch/gntplugin.h                              |   6 +-
 finch/plugins/gntgf.c                          |  20 +++---
 finch/plugins/gnttinyurl.c                     |  22 +++---
 libpurple/plugins.c                            |  68 ++++++++++----------
 libpurple/plugins.h                            |  84 ++++++++++++-------------
 libpurple/plugins/autoaccept.c                 |  20 +++---
 libpurple/plugins/helloworld.c                 |   2 +-
 libpurple/plugins/idle.c                       |   2 +-
 libpurple/plugins/joinpart.c                   |  24 +++---
 libpurple/plugins/log_reader.c                 |  34 +++++-----
 libpurple/plugins/newline.c                    |  24 +++---
 libpurple/plugins/notify_example.c             |   2 +-
 libpurple/plugins/offlinemsg.c                 |  20 +++---
 libpurple/plugins/pluginpref_example.c         |  20 +++---
 libpurple/plugins/psychic.c                    |  20 +++---
 libpurple/plugins/statenotify.c                |  24 +++---
 pidgin/gtkblist.c                              |  12 +-
 pidgin/gtkdocklet.c                            |  10 +-
 pidgin/gtkplugin.c                             |  52 ++++++++--------
 pidgin/gtkplugin.h                             |   6 +-
 pidgin/plugins/cap/cap.c                       |  22 +++---
 pidgin/plugins/contact_priority.c              |  20 +++---
 pidgin/plugins/convcolors.c                    |  20 +++---
 pidgin/plugins/disco/xmppdisco.c               |   2 +-
 pidgin/plugins/extplacement.c                  |  24 +++---
 pidgin/plugins/gestures/gestures.c             |  37 +++++-----
 pidgin/plugins/gevolution/gevolution.c         |  20 +++---
 pidgin/plugins/markerline.c                    |  20 +++---
 pidgin/plugins/musicmessaging/musicmessaging.c |  28 ++++----
 pidgin/plugins/notify.c                        |  24 +++---
 pidgin/plugins/pidginrc.c                      |  24 +++---
 pidgin/plugins/spellchk.c                      |  20 +++---
 pidgin/plugins/themeedit.c                     |   2 +-
 pidgin/plugins/win32/transparency/win2ktrans.c |  30 ++++----
 pidgin/plugins/win32/winprefs/winprefs.c       |  22 +++---
 pidgin/plugins/xmppconsole.c                   |   2 +-
 39 files changed, 421 insertions(+), 422 deletions(-)

diffs (truncated from 1554 to 300 lines):

diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -76,7 +76,7 @@ version 3.0.0 (??/??/????):
 		* purple_plugin_info_new
 		* purple_plugin_get_info
 		* purple_plugin_info_get_abi_version
-		* purple_plugin_info_get_actions_callback
+		* purple_plugin_info_get_actions_cb
 		* purple_plugin_info_get_category
 		* purple_plugin_info_get_dependencies
 		* purple_plugin_info_get_error
@@ -85,8 +85,8 @@ version 3.0.0 (??/??/????):
 		* purple_plugin_info_get_license_id
 		* purple_plugin_info_get_license_text
 		* purple_plugin_info_get_license_url
-		* purple_plugin_info_get_pref_frame_callback
-		* purple_plugin_info_get_pref_request_callback
+		* purple_plugin_info_get_pref_frame_cb
+		* purple_plugin_info_get_pref_request_cb
 		* purple_plugin_info_get_ui_data
 		* purple_plugin_info_set_ui_data
 		* purple_plugin_register_type
diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -2450,15 +2450,15 @@ static void
 build_plugin_actions(GntMenuItem *item, PurplePlugin *plugin)
 {
 	GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP);
-	PurplePluginGetActionsCallback get_actions;
+	PurplePluginActionsCb actions_cb;
 	GList *actions;
 	GntMenuItem *menuitem;
 
-	get_actions =
-		purple_plugin_info_get_actions_callback(purple_plugin_get_info(plugin));
+	actions_cb =
+		purple_plugin_info_get_actions_cb(purple_plugin_get_info(plugin));
 
 	gnt_menuitem_set_submenu(item, GNT_MENU(sub));
-	for (actions = get_actions(plugin); actions;
+	for (actions = actions_cb(plugin); actions;
 			actions = g_list_delete_link(actions, actions)) {
 		if (actions->data) {
 			PurplePluginAction *action = actions->data;
@@ -2573,7 +2573,7 @@ reconstruct_plugins_menu(void)
 		PurplePluginInfo *info = purple_plugin_get_info(plugin);
 		GntMenuItem *item;
 
-		if (!purple_plugin_info_get_actions_callback(info))
+		if (!purple_plugin_info_get_actions_cb(info))
 			continue;
 
 		item = gnt_menuitem_new(_(purple_plugin_info_get_name(info)));
diff --git a/finch/gntplugin.c b/finch/gntplugin.c
--- a/finch/gntplugin.c
+++ b/finch/gntplugin.c
@@ -47,13 +47,13 @@
 
 typedef struct
 {
-	FinchPluginFrame get_pref_frame;
+	FinchPluginPrefFrameCb pref_frame_cb;
 } FinchPluginInfoPrivate;
 
 enum
 {
 	PROP_0,
-	PROP_FINCH_PREFERENCES_FRAME,
+	PROP_FINCH_PREF_FRAME_CB,
 	PROP_LAST
 };
 
@@ -90,8 +90,8 @@ finch_plugin_info_set_property(GObject *
 	FinchPluginInfoPrivate *priv = FINCH_PLUGIN_INFO_GET_PRIVATE(obj);
 
 	switch (param_id) {
-		case PROP_FINCH_PREFERENCES_FRAME:
-			priv->get_pref_frame = g_value_get_pointer(value);
+		case PROP_FINCH_PREF_FRAME_CB:
+			priv->pref_frame_cb = g_value_get_pointer(value);
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -107,8 +107,8 @@ finch_plugin_info_get_property(GObject *
 	FinchPluginInfoPrivate *priv = FINCH_PLUGIN_INFO_GET_PRIVATE(obj);
 
 	switch (param_id) {
-		case PROP_FINCH_PREFERENCES_FRAME:
-			g_value_set_pointer(value, priv->get_pref_frame);
+		case PROP_FINCH_PREF_FRAME_CB:
+			g_value_set_pointer(value, priv->pref_frame_cb);
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -127,8 +127,8 @@ static void finch_plugin_info_class_init
 	obj_class->get_property = finch_plugin_info_get_property;
 	obj_class->set_property = finch_plugin_info_set_property;
 
-	g_object_class_install_property(obj_class, PROP_FINCH_PREFERENCES_FRAME,
-		g_param_spec_pointer("finch-preferences-frame",
+	g_object_class_install_property(obj_class, PROP_FINCH_PREF_FRAME_CB,
+		g_param_spec_pointer("finch-pref-frame-cb",
 		                     "Finch preferences frame callback",
 		                     "Callback that returns a GNT preferences frame",
 		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -195,9 +195,9 @@ has_prefs(PurplePlugin *plugin)
 	if (FINCH_IS_PLUGIN_INFO(info))
 		priv = FINCH_PLUGIN_INFO_GET_PRIVATE(info);
 
-	ret = ((priv && priv->get_pref_frame) ||
-			purple_plugin_info_get_pref_frame_callback(info) ||
-			purple_plugin_info_get_pref_request_callback(info));
+	ret = ((priv && priv->pref_frame_cb) ||
+			purple_plugin_info_get_pref_frame_cb(info) ||
+			purple_plugin_info_get_pref_request_cb(info));
 
 	return ret;
 }
@@ -394,7 +394,7 @@ configure_plugin_cb(GntWidget *button, g
 	if (FINCH_IS_PLUGIN_INFO(info))
 		priv = FINCH_PLUGIN_INFO_GET_PRIVATE(info);
 
-	if (priv && priv->get_pref_frame != NULL)
+	if (priv && priv->pref_frame_cb != NULL)
 	{
 		GntWidget *window = gnt_vbox_new(FALSE);
 		GntWidget *box, *button;
@@ -404,7 +404,7 @@ configure_plugin_cb(GntWidget *button, g
 				purple_plugin_info_get_name(info));
 		gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
 
-		box = priv->get_pref_frame();
+		box = priv->pref_frame_cb();
 		gnt_box_add_widget(GNT_BOX(window), box);
 
 		box = gnt_hbox_new(FALSE);
@@ -421,21 +421,21 @@ configure_plugin_cb(GntWidget *button, g
 		ui_data->type = FINCH_PLUGIN_UI_DATA_TYPE_WINDOW;
 		ui_data->u.window = window;
 	}
-	else if (purple_plugin_info_get_pref_request_callback(info))
+	else if (purple_plugin_info_get_pref_request_cb(info))
 	{
-		PurplePluginPrefRequestCallback get_pref_request = purple_plugin_info_get_pref_request_callback(info);
+		PurplePluginPrefRequestCb pref_request_cb = purple_plugin_info_get_pref_request_cb(info);
 		gpointer handle;
 
 		ui_data->type = FINCH_PLUGIN_UI_DATA_TYPE_REQUEST;
-		ui_data->u.request_handle = handle = get_pref_request(plugin);
+		ui_data->u.request_handle = handle = pref_request_cb(plugin);
 		purple_request_add_close_notify(handle,
 			purple_callback_set_zero, &info->ui_data);
 		purple_request_add_close_notify(handle, g_free, ui_data);
 	}
-	else if (purple_plugin_info_get_pref_frame_callback(info))
+	else if (purple_plugin_info_get_pref_frame_cb(info))
 	{
-		PurplePluginPrefFrameCallback get_pref_frame = purple_plugin_info_get_pref_frame_callback(info);
-		GntWidget *win = process_pref_frame(get_pref_frame(plugin));
+		PurplePluginPrefFrameCb pref_frame_cb = purple_plugin_info_get_pref_frame_cb(info);
+		GntWidget *win = process_pref_frame(pref_frame_cb(plugin));
 		g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(remove_confwin), plugin);
 
 		ui_data->type = FINCH_PLUGIN_UI_DATA_TYPE_WINDOW;
diff --git a/finch/gntplugin.h b/finch/gntplugin.h
--- a/finch/gntplugin.h
+++ b/finch/gntplugin.h
@@ -47,7 +47,7 @@ typedef struct _FinchPluginInfo FinchPlu
 /** @copydoc _FinchPluginInfoClass */
 typedef struct _FinchPluginInfoClass FinchPluginInfoClass;
 
-typedef GntWidget* (*FinchPluginFrame) (void);
+typedef GntWidget* (*FinchPluginPrefFrameCb) (void);
 
 /**
  * Extends #PurplePluginInfo to hold UI information for finch.
@@ -87,9 +87,9 @@ GType finch_plugin_info_get_type(void);
  * pairs.
  *
  * See purple_plugin_info_new() for a list of available property names.
- * Additionally, you can provide the property "finch-preferences-frame",
+ * Additionally, you can provide the property "finch-pref-frame-cb",
  * which should be a callback that returns a GntWidget for the plugin's
- * preferences (see FinchPluginFrame).
+ * preferences (see FinchPluginPrefFrameCb).
  *
  * @param first_property  The first property name
  * @param ...  The value of the first property, followed optionally by more
diff --git a/finch/plugins/gntgf.c b/finch/plugins/gntgf.c
--- a/finch/plugins/gntgf.c
+++ b/finch/plugins/gntgf.c
@@ -345,16 +345,16 @@ plugin_query(GError **error)
 	};
 
 	return finch_plugin_info_new(
-		"id",                      "gntgf",
-		"name",                    N_("GntGf"),
-		"version",                 DISPLAY_VERSION,
-		"category",                N_("Notification"),
-		"summary",                 N_("Toaster plugin"),
-		"description",             N_("Toaster plugin"),
-		"authors",                 authors,
-		"website",                 PURPLE_WEBSITE,
-		"abi-version",             PURPLE_ABI_VERSION,
-		"finch-preferences-frame", config_frame,
+		"id",                   "gntgf",
+		"name",                 N_("GntGf"),
+		"version",              DISPLAY_VERSION,
+		"category",             N_("Notification"),
+		"summary",              N_("Toaster plugin"),
+		"description",          N_("Toaster plugin"),
+		"authors",              authors,
+		"website",              PURPLE_WEBSITE,
+		"abi-version",          PURPLE_ABI_VERSION,
+		"finch-pref-frame-cb",  config_frame,
 		NULL
 	);
 }
diff --git a/finch/plugins/gnttinyurl.c b/finch/plugins/gnttinyurl.c
--- a/finch/plugins/gnttinyurl.c
+++ b/finch/plugins/gnttinyurl.c
@@ -437,17 +437,17 @@ plugin_query(GError **error)
 	};
 
 	return finch_plugin_info_new(
-		"id",                 "TinyURL",
-		"name",               N_("TinyURL"),
-		"version",            DISPLAY_VERSION,
-		"category",           N_("Utility"),
-		"summary",            N_("TinyURL plugin"),
-		"description",        N_("When receiving a message with URL(s), "
-		                         "use TinyURL for easier copying"),
-		"authors",            authors,
-		"website",            PURPLE_WEBSITE,
-		"abi-version",        PURPLE_ABI_VERSION,
-		"preferences-frame",  get_plugin_pref_frame,
+		"id",             "TinyURL",
+		"name",           N_("TinyURL"),
+		"version",        DISPLAY_VERSION,
+		"category",       N_("Utility"),
+		"summary",        N_("TinyURL plugin"),
+		"description",    N_("When receiving a message with URL(s), "
+		                     "use TinyURL for easier copying"),
+		"authors",        authors,
+		"website",        PURPLE_WEBSITE,
+		"abi-version",    PURPLE_ABI_VERSION,
+		"pref-frame-cb",  get_plugin_pref_frame,
 		NULL
 	);
 }
diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -43,13 +43,13 @@ struct _PurplePluginInfoPrivate {
 	PurplePluginInfoFlags flags; /**< Flags for the plugin */
 
 	/** Callback that returns a list of actions the plugin can perform */
-	PurplePluginGetActionsCallback get_actions;
+	PurplePluginActionsCb actions_cb;
 
 	/** Callback that returns a preferences frame for a plugin */
-	PurplePluginPrefFrameCallback get_pref_frame;
+	PurplePluginPrefFrameCb pref_frame_cb;
 
 	/** Callback that returns a preferences request handle for a plugin */
-	PurplePluginPrefRequestCallback get_pref_request;
+	PurplePluginPrefRequestCb pref_request_cb;
 
 	/** TRUE if a plugin has been unloaded at least once. Auto-load
 	 *  plugins that have been unloaded once will not be auto-loaded again. */
@@ -60,9 +60,9 @@ enum
 {
 	PROP_0,
 	PROP_UI_REQUIREMENT,
-	PROP_GET_ACTIONS,
-	PROP_PREFERENCES_FRAME,
-	PROP_PREFERENCES_REQUEST,
+	PROP_ACTIONS_CB,
+	PROP_PREF_FRAME_CB,
+	PROP_PREF_REQUEST_CB,
 	PROP_FLAGS,
 	PROP_LAST
 };
@@ -375,14 +375,14 @@ purple_plugin_info_set_property(GObject 
 		case PROP_UI_REQUIREMENT:
 			priv->ui_requirement = g_strdup(g_value_get_string(value));
 			break;
-		case PROP_GET_ACTIONS:
-			priv->get_actions = g_value_get_pointer(value);
+		case PROP_ACTIONS_CB:
+			priv->actions_cb = g_value_get_pointer(value);
 			break;
-		case PROP_PREFERENCES_FRAME:
-			priv->get_pref_frame = g_value_get_pointer(value);
+		case PROP_PREF_FRAME_CB:
+			priv->pref_frame_cb = g_value_get_pointer(value);
 			break;
-		case PROP_PREFERENCES_REQUEST:



More information about the Commits mailing list