[glib] Improve glib-genmarshal man page
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve glib-genmarshal man page
- Date: Thu, 16 Aug 2012 22:45:52 +0000 (UTC)
commit 2ccf64ba59cfcc472a658b036b8a919aa081ea7f
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Aug 16 18:44:41 2012 -0400
Improve glib-genmarshal man page
Expand the example in glib-genmarshal.1 to include the actual
commandline invocations, and update the generated function
names to match reality.
https://bugzilla.gnome.org/show_bug.cgi?id=637460
docs/reference/gobject/glib-genmarshal.xml | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/docs/reference/gobject/glib-genmarshal.xml b/docs/reference/gobject/glib-genmarshal.xml
index db4f692..1d8e146 100644
--- a/docs/reference/gobject/glib-genmarshal.xml
+++ b/docs/reference/gobject/glib-genmarshal.xml
@@ -333,7 +333,7 @@ gfloat baz (gpointer data1,
gpointer data2);
</programlisting>
<para>
-The marshaller list has to look like this:
+The <filename>marshaller.list</filename> file has to look like this:
</para>
<programlisting>
VOID:VOID
@@ -341,13 +341,20 @@ VOID:INT
FLOAT:BOOLEAN,UCHAR
</programlisting>
<para>
+and you call glib-genmarshal like this:
+</para>
+<programlisting>
+glib-genmarshal --header marshaller.list > marshaller.h
+glib-genmarshal --body marshaller.list > marshaller.c
+</programlisting>
+<para>
The generated marshallers have the arguments encoded in their function name.
For this particular list, they are
</para>
<programlisting>
-g_cclosure_marshal_VOID__VOID(),
-g_cclosure_marshal_VOID__INT(),
-g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR().
+g_cclosure_user_marshal_VOID__VOID(),
+g_cclosure_user_marshal_VOID__INT(),
+g_cclosure_user_marshal_FLOAT__BOOLEAN_UCHAR().
</programlisting>
<para>
They can be used directly for GClosures or be passed in as the
@@ -357,11 +364,11 @@ GSignalCMarshaller c_marshaller; argument upon creation of signals:
GClosure *cc_foo, *cc_bar, *cc_baz;
cc_foo = g_cclosure_new (NULL, foo, NULL);
-g_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID);
+g_closure_set_marshal (cc_foo, g_cclosure_user_marshal_VOID__VOID);
cc_bar = g_cclosure_new (NULL, bar, NULL);
-g_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT);
+g_closure_set_marshal (cc_bar, g_cclosure_user_marshal_VOID__INT);
cc_baz = g_cclosure_new (NULL, baz, NULL);
-g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);
+g_closure_set_marshal (cc_baz, g_cclosure_user_marshal_FLOAT__BOOLEAN_UCHAR);
</programlisting>
</refsect1>
<refsect1><title>See also</title>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]