/pidgin/main: 81f41f7bca98: Box PidginXferDialog

Ankit Vani a at nevitus.org
Mon Mar 31 05:08:58 EDT 2014


Changeset: 81f41f7bca98ba2e6c4df1f057939dab87112317
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-03-31 14:38 +0530
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/81f41f7bca98

Description:

Box PidginXferDialog

diffstat:

 pidgin/gtkxfer.c |  39 +++++++++++++++++++++++++++++++++++++++
 pidgin/gtkxfer.h |   9 +++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diffs (82 lines):

diff --git a/pidgin/gtkxfer.c b/pidgin/gtkxfer.c
--- a/pidgin/gtkxfer.c
+++ b/pidgin/gtkxfer.c
@@ -37,6 +37,8 @@
 
 struct _PidginXferDialog
 {
+	gint box_count;
+
 	gboolean keep_open;
 	gboolean auto_clear;
 
@@ -1077,6 +1079,43 @@ pidgin_xfer_dialog_update_xfer(PidginXfe
 }
 
 /**************************************************************************
+ * PidginXferDialog GBoxed code
+ **************************************************************************/
+static PidginXferDialog *
+pidgin_xfer_dialog_ref(PidginXferDialog *dialog)
+{
+	g_return_val_if_fail(dialog != NULL, NULL);
+
+	dialog->box_count++;
+
+	return dialog;
+}
+
+static void
+pidgin_xfer_dialog_unref(PidginXferDialog *dialog)
+{
+	g_return_if_fail(dialog != NULL);
+	g_return_if_fail(dialog->box_count >= 0);
+
+	if (!dialog->box_count--)
+		pidgin_xfer_dialog_destroy(dialog);
+}
+
+GType
+pidgin_xfer_dialog_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PidginXferDialog",
+				(GBoxedCopyFunc)pidgin_xfer_dialog_ref,
+				(GBoxedFreeFunc)pidgin_xfer_dialog_unref);
+	}
+
+	return type;
+}
+
+/**************************************************************************
  * File Transfer UI Ops
  **************************************************************************/
 static void
diff --git a/pidgin/gtkxfer.h b/pidgin/gtkxfer.h
--- a/pidgin/gtkxfer.h
+++ b/pidgin/gtkxfer.h
@@ -40,6 +40,8 @@
  */
 typedef struct _PidginXferDialog PidginXferDialog;
 
+#define PIDGIN_TYPE_XFER_DIALOG (pidgin_xfer_dialog_get_type())
+
 G_BEGIN_DECLS
 
 /**************************************************************************/
@@ -47,6 +49,13 @@ G_BEGIN_DECLS
 /**************************************************************************/
 
 /**
+ * pidgin_xfer_dialog_get_type:
+ *
+ * Returns: The #GType for the #PidginXferDialog boxed structure.
+ */
+GType pidgin_xfer_dialog_get_type(void);
+
+/**
  * pidgin_xfer_dialog_new:
  *
  * Creates a new file transfer dialog.



More information about the Commits mailing list