summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-08-16 18:44:41 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-08-16 18:46:17 -0400
commit2ccf64ba59cfcc472a658b036b8a919aa081ea7f (patch)
tree10b27f1e1155eb9bf1c65c63e1c7715aa670d762 /docs
parentaa50b8aec31df6951070ed9674ab3b14dc6d2759 (diff)
downloadglib-2ccf64ba59cfcc472a658b036b8a919aa081ea7f.tar.gz
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
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/gobject/glib-genmarshal.xml21
1 files changed, 14 insertions, 7 deletions
diff --git a/docs/reference/gobject/glib-genmarshal.xml b/docs/reference/gobject/glib-genmarshal.xml
index db4f69241..1d8e1467d 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>