soc.2010.detachablepurple: 535b8955: Added a GClosure marshaller which takes ...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sat Jul 31 01:35:53 EDT 2010


----------------------------------------------------------------------
Revision: 535b89550cc586eab898d7f6ed2636c7b67e1bb0
Parent:   0b1a97562764e5fcaadb2c21352016c948cf4a0f
Author:   gillux at soc.pidgin.im
Date:     07/29/10 23:59:22
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/535b89550cc586eab898d7f6ed2636c7b67e1bb0

Changelog: 

Added a GClosure marshaller which takes zero parameters. Will be useful in purpled.

Changes against parent 0b1a97562764e5fcaadb2c21352016c948cf4a0f

  added    purpled/nullmarshaller.c
  added    purpled/nullmarshaller.h
  patched  purpled/Makefile.am

-------------- next part --------------
============================================================
--- purpled/Makefile.am	f034626f8db2c1b7005adc8d70fbfae7b30789f5
+++ purpled/Makefile.am	fb15ce6071d8906607f80620ea3bce90f35f21c3
@@ -10,10 +10,10 @@ purpled_SOURCES = \
 bin_PROGRAMS = purpled
 
 purpled_SOURCES = \
-	purpled.c purpled-account.c
+	purpled.c purpled-account.c nullmarshaller.c
 
 purpled_headers = \
-	purpled.h purpled-account.h
+	purpled.h purpled-account.h nullmarshaller.h
 
 purpled_LDFLAGS = 
 purpled_LDADD = \
============================================================
--- /dev/null	
+++ purpled/nullmarshaller.c	932b2af022a35ae40664dee7c3dad616d9839b63
@@ -0,0 +1,18 @@
+
+#include <glib-object.h>
+
+#include "nullmarshaller.h"
+
+void
+purpled_nullmarshaller(GClosure *closure, GValue *return_value,
+                       guint n_param_values, const GValue *param_values,
+                       gpointer invocation_hint, gpointer marshal_data)
+{
+	GSourceFunc callback;
+	GCClosure *cc = (GCClosure*) closure;
+
+	g_return_if_fail(n_param_values == 0);
+
+	callback = (GSourceFunc) (marshal_data ? marshal_data : cc->callback);
+	callback(closure->data);
+}
============================================================
--- /dev/null	
+++ purpled/nullmarshaller.h	39cc748ac8b85ea8c33d79501239a13d2eb15663
@@ -0,0 +1,10 @@
+
+/**
+ * A very simple marshaller that aims to be used in GClosures.
+ * It takes zero parameters so executes the callback only giving the closure
+ * user_data. We created it by hand, because such a marshaller can't be
+ * created by glib-genmarshal. This tool create marshallers that always
+ * take at least a GObject as first parameter, and then the parameters red in
+ * the marshallers.list file.
+ */
+void purpled_nullmarshaller(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);


More information about the Commits mailing list