/soc/2013/ankitkv/gobjectification: 1615d90aa584: Refactored pid...
Ankit Vani
a at nevitus.org
Thu Jul 18 17:46:08 EDT 2013
Changeset: 1615d90aa58406b62007d8da41ef4002316c28c1
Author: Ankit Vani <a at nevitus.org>
Date: 2013-07-19 03:15 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/1615d90aa584
Description:
Refactored pidgin to use GType instead of PurpleValue
diffstat:
pidgin/gtkaccount.c | 5 +-
pidgin/gtkblist.c | 28 ++++++----------
pidgin/gtkconv.c | 86 ++++++++++++++++------------------------------------
pidgin/gtklog.c | 8 +---
4 files changed, 42 insertions(+), 85 deletions(-)
diffs (212 lines):
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -2947,9 +2947,8 @@ pidgin_accounts_init(void)
g_free(default_avatar);
purple_signal_register(pidgin_accounts_get_handle(), "account-modified",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_ACCOUNT));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ PURPLE_TYPE_ACCOUNT);
/* Setup some purple signal handlers. */
purple_signal_connect(purple_connections_get_handle(), "signed-on",
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -7756,32 +7756,26 @@ void pidgin_blist_init(void)
/* Register our signals */
purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_BLIST));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ PURPLE_TYPE_BUDDY_LIST);
purple_signal_register(gtk_blist_handle, "gtkblist-unhiding",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_BLIST));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ PURPLE_TYPE_BUDDY_LIST);
purple_signal_register(gtk_blist_handle, "gtkblist-created",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_BLIST));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ PURPLE_TYPE_BUDDY_LIST);
purple_signal_register(gtk_blist_handle, "drawing-tooltip",
- purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_BLIST_NODE),
- purple_value_new_outgoing(PURPLE_TYPE_BOXED, "GString *"),
- purple_value_new(PURPLE_TYPE_BOOLEAN));
+ purple_marshal_VOID__POINTER_POINTER_UINT, G_TYPE_NONE,
+ 3, PURPLE_TYPE_BLIST_NODE,
+ G_TYPE_POINTER, /* pointer to a (GString *) */
+ G_TYPE_BOOLEAN);
purple_signal_register(gtk_blist_handle, "drawing-buddy",
purple_marshal_POINTER__POINTER,
- purple_value_new(PURPLE_TYPE_STRING), 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_BLIST_BUDDY));
+ G_TYPE_STRING, 1, PURPLE_TYPE_BUDDY);
purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on",
gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -8607,11 +8607,9 @@ pidgin_conversations_init(void)
* Register signals
**********************************************************************/
purple_signal_register(handle, "conversation-dragging",
- purple_marshal_VOID__POINTER_POINTER, NULL, 2,
- purple_value_new(PURPLE_TYPE_BOXED,
- "PidginWindow *"),
- purple_value_new(PURPLE_TYPE_BOXED,
- "PidginWindow *"));
+ purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2,
+ G_TYPE_POINTER, /* pointer to a (PidginWindow *) */
+ G_TYPE_POINTER); /* pointer to a (PidginWindow *) */
purple_signal_register(handle, "conversation-timestamp",
#if SIZEOF_TIME_T == 4
@@ -8621,90 +8619,58 @@ pidgin_conversations_init(void)
#else
#error Unkown size of time_t
#endif
- purple_value_new(PURPLE_TYPE_STRING), 3,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_CONVERSATION),
+ G_TYPE_STRING, 3, PURPLE_TYPE_CONVERSATION,
#if SIZEOF_TIME_T == 4
- purple_value_new(PURPLE_TYPE_INT),
+ G_TYPE_INT,
#elif SIZEOF_TIME_T == 8
- purple_value_new(PURPLE_TYPE_INT64),
+ G_TYPE_INT64,
#else
# error Unknown size of time_t
#endif
- purple_value_new(PURPLE_TYPE_BOOLEAN));
+ G_TYPE_BOOLEAN);
purple_signal_register(handle, "displaying-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(PURPLE_TYPE_STRING),
- purple_value_new_outgoing(PURPLE_TYPE_STRING),
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_CONVERSATION),
- purple_value_new(PURPLE_TYPE_INT));
+ G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+ G_TYPE_POINTER, /* pointer to a string */
+ PURPLE_TYPE_CONVERSATION, G_TYPE_INT);
purple_signal_register(handle, "displayed-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_INT));
+ G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+ G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_INT);
purple_signal_register(handle, "displaying-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(PURPLE_TYPE_STRING),
- purple_value_new_outgoing(PURPLE_TYPE_STRING),
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_CONVERSATION),
- purple_value_new(PURPLE_TYPE_INT));
+ G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+ G_TYPE_POINTER, /* pointer to a string */
+ PURPLE_TYPE_CONVERSATION, G_TYPE_INT);
purple_signal_register(handle, "displayed-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_INT));
+ G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+ G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_INT);
purple_signal_register(handle, "conversation-switched",
- 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-hiding",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_BOXED,
- "PidginConversation *"));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ G_TYPE_POINTER); /* (PidginConversation *) */
purple_signal_register(handle, "conversation-displayed",
- purple_marshal_VOID__POINTER, NULL, 1,
- purple_value_new(PURPLE_TYPE_BOXED,
- "PidginConversation *"));
+ purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+ G_TYPE_POINTER); /* (PidginConversation *) */
purple_signal_register(handle, "chat-nick-autocomplete",
purple_marshal_BOOLEAN__POINTER_BOOLEAN,
- purple_value_new(PURPLE_TYPE_BOOLEAN), 1,
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_CONVERSATION));
+ G_TYPE_BOOLEAN, 1, PURPLE_TYPE_CONVERSATION);
purple_signal_register(handle, "chat-nick-clicked",
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);
/**********************************************************************
diff --git a/pidgin/gtklog.c b/pidgin/gtklog.c
--- a/pidgin/gtklog.c
+++ b/pidgin/gtklog.c
@@ -850,11 +850,9 @@ void pidgin_log_init(void)
purple_signal_register(handle, "log-displaying",
purple_marshal_VOID__POINTER_POINTER,
- NULL, 2,
- purple_value_new(PURPLE_TYPE_BOXED,
- "PidginLogViewer *"),
- purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_LOG));
+ G_TYPE_NONE, 2,
+ G_TYPE_POINTER, /* (PidginLogViewer *) */
+ PURPLE_TYPE_LOG);
}
void
More information about the Commits
mailing list