/pidgin/main: 5c4846317f2f: Box the *UiOps structures

Ankit Vani a at nevitus.org
Sat Feb 15 11:40:12 EST 2014


Changeset: 5c4846317f2f91a2259a53abfd305b5c11b8e48d
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-15 22:09 +0530
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/5c4846317f2f

Description:

Box the *UiOps structures

diffstat:

 libpurple/accounts.c     |  35 +++++++++++++++++++++++++++++++++++
 libpurple/accounts.h     |   9 +++++++++
 libpurple/buddylist.c    |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/buddylist.h    |   9 +++++++++
 libpurple/connection.c   |  35 +++++++++++++++++++++++++++++++++++
 libpurple/connection.h   |  13 +++++++++++--
 libpurple/conversation.c |  35 +++++++++++++++++++++++++++++++++++
 libpurple/conversation.h |   9 +++++++++
 libpurple/core.c         |  35 +++++++++++++++++++++++++++++++++++
 libpurple/core.h         |  10 ++++++++++
 libpurple/debug.c        |  35 +++++++++++++++++++++++++++++++++++
 libpurple/debug.h        |  11 +++++++++++
 libpurple/dnsquery.c     |  35 +++++++++++++++++++++++++++++++++++
 libpurple/dnsquery.h     |   9 +++++++++
 libpurple/dnssrv.c       |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/dnssrv.h       |  10 ++++++++++
 libpurple/eventloop.c    |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/eventloop.h    |  10 ++++++++++
 libpurple/idle.c         |  35 +++++++++++++++++++++++++++++++++++
 libpurple/idle.h         |  10 ++++++++++
 libpurple/notify.c       |  35 +++++++++++++++++++++++++++++++++++
 libpurple/notify.h       |   8 ++++++++
 libpurple/request.c      |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/request.h      |   9 +++++++++
 libpurple/roomlist.c     |  40 ++++++++++++++++++++++++++++++++++++++--
 libpurple/roomlist.h     |   9 +++++++++
 libpurple/sound.c        |  35 +++++++++++++++++++++++++++++++++++
 libpurple/sound.h        |   9 +++++++++
 libpurple/whiteboard.c   |  35 +++++++++++++++++++++++++++++++++++
 libpurple/whiteboard.h   |   9 +++++++++
 libpurple/xfer.c         |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/xfer.h         |   9 +++++++++
 32 files changed, 729 insertions(+), 4 deletions(-)

diffs (truncated from 1170 to 300 lines):

diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -821,6 +821,41 @@ purple_accounts_restore_current_statuses
 	}
 }
 
+static PurpleAccountUiOps *
+purple_account_ui_ops_copy(PurpleAccountUiOps *ops)
+{
+	PurpleAccountUiOps *ops_new;
+
+	g_return_val_if_fail(ops != NULL, NULL);
+
+	ops_new = g_new(PurpleAccountUiOps, 1);
+	*ops_new = *ops;
+
+	return ops_new;
+}
+
+static void
+purple_account_ui_ops_free(PurpleAccountUiOps *ops)
+{
+	g_return_if_fail(ops != NULL);
+
+	g_free(ops);
+}
+
+GType
+purple_account_ui_ops_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PurpleAccountUiOps",
+				(GBoxedCopyFunc)purple_account_ui_ops_copy,
+				(GBoxedFreeFunc)purple_account_ui_ops_free);
+	}
+
+	return type;
+}
+
 void
 purple_accounts_set_ui_ops(PurpleAccountUiOps *ops)
 {
diff --git a/libpurple/accounts.h b/libpurple/accounts.h
--- a/libpurple/accounts.h
+++ b/libpurple/accounts.h
@@ -32,6 +32,8 @@
 #include "account.h"
 #include "status.h"
 
+#define PURPLE_TYPE_ACCOUNT_UI_OPS (purple_account_ui_ops_get_type())
+
 typedef struct _PurpleAccountUiOps  PurpleAccountUiOps;
 
 /**
@@ -189,6 +191,13 @@ void purple_accounts_restore_current_sta
 /**************************************************************************/
 
 /**
+ * purple_account_ui_ops_get_type:
+ *
+ * Returns: The #GType for the #PurpleAccountUiOps boxed structure.
+ */
+GType purple_account_ui_ops_get_type(void);
+
+/**
  * purple_accounts_set_ui_ops:
  * @ops: The UI operations structure.
  *
diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -2017,6 +2017,44 @@ purple_blist_uninit(void)
 }
 
 /**************************************************************************
+ * GBoxed code
+ **************************************************************************/
+static PurpleBlistUiOps *
+purple_blist_ui_ops_copy(PurpleBlistUiOps *ops)
+{
+	PurpleBlistUiOps *ops_new;
+
+	g_return_val_if_fail(ops != NULL, NULL);
+
+	ops_new = g_new(PurpleBlistUiOps, 1);
+	*ops_new = *ops;
+
+	return ops_new;
+}
+
+static void
+purple_blist_ui_ops_free(PurpleBlistUiOps *ops)
+{
+	g_return_if_fail(ops != NULL);
+
+	g_free(ops);
+}
+
+GType
+purple_blist_ui_ops_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PurpleBlistUiOps",
+				(GBoxedCopyFunc)purple_blist_ui_ops_copy,
+				(GBoxedFreeFunc)purple_blist_ui_ops_free);
+	}
+
+	return type;
+}
+
+/**************************************************************************
  * GObject code
  **************************************************************************/
 
diff --git a/libpurple/buddylist.h b/libpurple/buddylist.h
--- a/libpurple/buddylist.h
+++ b/libpurple/buddylist.h
@@ -43,6 +43,8 @@
 typedef struct _PurpleBuddyList       PurpleBuddyList;
 typedef struct _PurpleBuddyListClass  PurpleBuddyListClass;
 
+#define PURPLE_TYPE_BLIST_UI_OPS (purple_blist_ui_ops_get_type())
+
 typedef struct _PurpleBlistUiOps PurpleBlistUiOps;
 
 /**************************************************************************/
@@ -479,6 +481,13 @@ void purple_blist_request_add_group(void
 /**************************************************************************/
 
 /**
+ * purple_blist_ui_ops_get_type:
+ *
+ * Returns: The #GType for the #PurpleBlistUiOps boxed structure.
+ */
+GType purple_blist_ui_ops_get_type(void);
+
+/**
  * purple_blist_set_ui_ops:
  * @ops: The ops struct.
  *
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -593,6 +593,41 @@ purple_connection_error_info_new(PurpleC
 /**************************************************************************
  * GBoxed code
  **************************************************************************/
+static PurpleConnectionUiOps *
+purple_connection_ui_ops_copy(PurpleConnectionUiOps *ops)
+{
+	PurpleConnectionUiOps *ops_new;
+
+	g_return_val_if_fail(ops != NULL, NULL);
+
+	ops_new = g_new(PurpleConnectionUiOps, 1);
+	*ops_new = *ops;
+
+	return ops_new;
+}
+
+static void
+purple_connection_ui_ops_free(PurpleConnectionUiOps *ops)
+{
+	g_return_if_fail(ops != NULL);
+
+	g_free(ops);
+}
+
+GType
+purple_connection_ui_ops_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PurpleConnectionUiOps",
+				(GBoxedCopyFunc)purple_connection_ui_ops_copy,
+				(GBoxedFreeFunc)purple_connection_ui_ops_free);
+	}
+
+	return type;
+}
+
 static PurpleConnectionErrorInfo *
 purple_connection_error_info_copy(PurpleConnectionErrorInfo *err)
 {
diff --git a/libpurple/connection.h b/libpurple/connection.h
--- a/libpurple/connection.h
+++ b/libpurple/connection.h
@@ -36,13 +36,15 @@
 #define PURPLE_IS_CONNECTION_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CONNECTION))
 #define PURPLE_CONNECTION_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CONNECTION, PurpleConnectionClass))
 
-#define PURPLE_TYPE_CONNECTION_ERROR_INFO  (purple_connection_error_info_get_type())
-
 typedef struct _PurpleConnection PurpleConnection;
 typedef struct _PurpleConnectionClass PurpleConnectionClass;
 
+#define PURPLE_TYPE_CONNECTION_UI_OPS  (purple_connection_ui_ops_get_type())
+
 typedef struct _PurpleConnectionUiOps PurpleConnectionUiOps;
 
+#define PURPLE_TYPE_CONNECTION_ERROR_INFO  (purple_connection_error_info_get_type())
+
 typedef struct _PurpleConnectionErrorInfo PurpleConnectionErrorInfo;
 
 /**
@@ -576,6 +578,13 @@ GList *purple_connections_get_connecting
 /**************************************************************************/
 
 /**
+ * purple_connection_ui_ops_get_type:
+ *
+ * Returns: The #GType for the #PurpleConnectionUiOps boxed structure.
+ */
+GType purple_connection_ui_ops_get_type(void);
+
+/**
  * purple_connections_set_ui_ops:
  * @ops: The UI operations structure.
  *
diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -297,6 +297,41 @@ purple_conversation_get_features(PurpleC
 	return priv->features;
 }
 
+static PurpleConversationUiOps *
+purple_conversation_ui_ops_copy(PurpleConversationUiOps *ops)
+{
+	PurpleConversationUiOps *ops_new;
+
+	g_return_val_if_fail(ops != NULL, NULL);
+
+	ops_new = g_new(PurpleConversationUiOps, 1);
+	*ops_new = *ops;
+
+	return ops_new;
+}
+
+static void
+purple_conversation_ui_ops_free(PurpleConversationUiOps *ops)
+{
+	g_return_if_fail(ops != NULL);
+
+	g_free(ops);
+}
+
+GType
+purple_conversation_ui_ops_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PurpleConversationUiOps",
+				(GBoxedCopyFunc)purple_conversation_ui_ops_copy,
+				(GBoxedFreeFunc)purple_conversation_ui_ops_free);
+	}
+
+	return type;
+}
+
 void
 purple_conversation_set_ui_ops(PurpleConversation *conv,
 							 PurpleConversationUiOps *ops)
diff --git a/libpurple/conversation.h b/libpurple/conversation.h
--- a/libpurple/conversation.h
+++ b/libpurple/conversation.h
@@ -35,6 +35,8 @@
 #define PURPLE_IS_CONVERSATION_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CONVERSATION))
 #define PURPLE_CONVERSATION_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CONVERSATION, PurpleConversationClass))
 
+#define PURPLE_TYPE_CONVERSATION_UI_OPS      (purple_conversation_ui_ops_get_type())
+
 #define PURPLE_TYPE_CONVERSATION_MESSAGE     (purple_conversation_message_get_type())
 
 /**************************************************************************/
@@ -310,6 +312,13 @@ G_BEGIN_DECLS
 GType purple_conversation_get_type(void);
 
 /**
+ * purple_conversation_ui_ops_get_type:
+ *
+ * Returns: The #GType for the #PurpleConversationUiOps boxed structure.
+ */
+GType purple_conversation_ui_ops_get_type(void);
+
+/**
  * purple_conversation_present:
  * @conv: The conversation to present
  *
diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -340,6 +340,41 @@ purple_get_core(void)



More information about the Commits mailing list