/soc/2013/ankitkv/gobjectification: 2846034a2e68: Refactored con...

Ankit Vani a at nevitus.org
Wed Jul 17 16:45:00 EDT 2013


Changeset: 2846034a2e6886a0bf0e689cf44780d8d185c743
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-18 02:14 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/2846034a2e68

Description:

Refactored conversation signal registrations to use GType instead of PurpleValue

diffstat:

 libpurple/conversations.c |  294 ++++++++++++++-------------------------------
 1 files changed, 92 insertions(+), 202 deletions(-)

diffs (truncated from 392 to 300 lines):

diff --git a/libpurple/conversations.c b/libpurple/conversations.c
--- a/libpurple/conversations.c
+++ b/libpurple/conversations.c
@@ -285,296 +285,186 @@ purple_conversations_init(void)
 	 **********************************************************************/
 	purple_signal_register(handle, "writing-im-msg",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_POINTER, /* pointer to a string */
+						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "wrote-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
-						 NULL, 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sent-attention",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT,
-						 NULL, 4,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 4, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "got-attention",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT,
-						 NULL, 4,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 4, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sending-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER,
-						 NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING));
+						 G_TYPE_NONE, 3, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_POINTER); /* pointer to a string */
 
 	purple_signal_register(handle, "sent-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER,
-						 NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 G_TYPE_NONE, 3, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING);
 
 	purple_signal_register(handle, "receiving-im-msg",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new_outgoing(PURPLE_TYPE_UINT));
+						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT,
+						 G_TYPE_POINTER, /* pointer to a string */
+						 G_TYPE_POINTER, /* pointer to a string */
+						 PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_POINTER); /* pointer to a string */
 
 	purple_signal_register(handle, "received-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
-						 NULL, 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "blocked-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT,
-						 NULL, 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-							 PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_UINT),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT);
 
 	purple_signal_register(handle, "writing-chat-msg",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_POINTER, /* pointer to a string */
+						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "wrote-chat-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
-						 NULL, 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sending-chat-msg",
-						 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
+						 3, PURPLE_TYPE_ACCOUNT,
+						 G_TYPE_POINTER, /* pointer to a string */
+						 G_TYPE_UINT);
 
 	purple_signal_register(handle, "sent-chat-msg",
-						 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
+						 3, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING, G_TYPE_UINT);
 
 	purple_signal_register(handle, "receiving-chat-msg",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new_outgoing(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new_outgoing(PURPLE_TYPE_UINT));
+						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT,
+						 G_TYPE_POINTER, /* pointer to a string */
+						 G_TYPE_POINTER, /* pointer to a string */
+						 PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_POINTER); /* pointer to an unsigned int */
 
 	purple_signal_register(handle, "received-chat-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
-						 NULL, 5,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "conversation-created",
-						 purple_marshal_VOID__POINTER, NULL, 1,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION));
+						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+						 PURPLE_TYPE_CONVERSATION);
 
 	purple_signal_register(handle, "conversation-updated",
-						 purple_marshal_VOID__POINTER_UINT, NULL, 2,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 purple_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2,
+						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "deleting-conversation",
-						 purple_marshal_VOID__POINTER, NULL, 1,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION));
+						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+						 PURPLE_TYPE_CONVERSATION);
 
 	purple_signal_register(handle, "buddy-typing",
-						 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
+						 PURPLE_TYPE_ACCOUNT, G_TYPE_STRING);
 
 	purple_signal_register(handle, "buddy-typed",
-						 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
+						 PURPLE_TYPE_ACCOUNT, G_TYPE_STRING);
 
 	purple_signal_register(handle, "buddy-typing-stopped",
-						 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
+						 PURPLE_TYPE_ACCOUNT, G_TYPE_STRING);
 
 	purple_signal_register(handle, "chat-user-joining",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_UINT,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 G_TYPE_BOOLEAN, 3, PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_STRING, G_TYPE_UINT);
 
 	purple_signal_register(handle, "chat-user-joined",
-						 purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_UINT),
-						 purple_value_new(PURPLE_TYPE_BOOLEAN));
+						 purple_marshal_VOID__POINTER_POINTER_UINT_UINT,
+						 G_TYPE_NONE, 4, PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_STRING, G_TYPE_UINT, G_TYPE_BOOLEAN);
 
 	purple_signal_register(handle, "chat-user-flags",
-						 purple_marshal_VOID__POINTER_UINT_UINT, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CHATUSER),
-						 purple_value_new(PURPLE_TYPE_UINT),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 purple_marshal_VOID__POINTER_UINT_UINT, G_TYPE_NONE, 3,
+						 PURPLE_TYPE_CHAT_USER, G_TYPE_UINT, G_TYPE_UINT);
 
 	purple_signal_register(handle, "chat-user-leaving",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
-						 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 G_TYPE_BOOLEAN, 3, PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_STRING, G_TYPE_STRING);
 
 	purple_signal_register(handle, "chat-user-left",
-						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 purple_marshal_VOID__POINTER_POINTER_POINTER,
+						 G_TYPE_NONE, 3, PURPLE_TYPE_CONVERSATION,
+						 G_TYPE_STRING, G_TYPE_STRING);
 
 	purple_signal_register(handle, "deleting-chat-user",
-						 purple_marshal_VOID__POINTER, NULL, 1,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CHATUSER));
+						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+						 PURPLE_TYPE_CHAT_USER);
 
 	purple_signal_register(handle, "chat-inviting-user",
-						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION),



More information about the Commits mailing list