10139N/A<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
10139N/A<!ENTITY cmd "glib-genmarshal">
10139N/A<!ENTITY % commonents SYSTEM "smancommon.ent">
10139N/A%commonents;
10139N/A<!ENTITY % booktitles SYSTEM "booktitles.ent">
10139N/A%booktitles;
10139N/A<!ENTITY suncopy "Copyright (c) 2003,2006 Sun Microsystems, Inc. All Rights Reserved.">
10139N/A]>
10139N/A<refentry id="glib-genmarshal-1">
10139N/A<!-- %Z%%M% %I% %E% SMI; -->
10139N/A<refmeta><refentrytitle>glib-genmarshal</refentrytitle><manvolnum>1</manvolnum>
10139N/A<refmiscinfo class="date">7 Apr 2003</refmiscinfo>
10139N/A<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
10139N/A<refmiscinfo class="software">&release;</refmiscinfo>
10139N/A<refmiscinfo class="arch">generic</refmiscinfo>
10139N/A<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
10139N/A</refmeta>
17616N/A<indexterm><primary>glib-genmarshal</primary></indexterm>
17616N/A<indexterm><primary>generates C code marshallers for GLib closures</primary></indexterm>
17616N/A<refnamediv id="glib-genmarshal-1-name"><refname>glib-genmarshal</refname>
17616N/A<refpurpose>generates C code marshallers for GLib closures</refpurpose>
17616N/A</refnamediv>
10139N/A<refsynopsisdiv id="glib-genmarshal-1-synp"><title>&synp-tt;</title>
10139N/A<cmdsynopsis><command>&cmd;</command>
10139N/A<arg choice="opt"><option>-body</option></arg>
10139N/A<arg choice="opt"><option>-g-fatal-warnings</option></arg>
10139N/A<arg choice="opt"><option>-header</option></arg>
10139N/A<arg choice="opt"><option>-help</option></arg>
11153N/A<arg choice="opt"><option>-internal</option></arg>
10139N/A<arg choice="opt"><option>-nostdinc</option> | <option>-stdinc</option></arg>
10139N/A<arg choice="opt"><option>-prefix=<replaceable>dir</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-skip-source</option></arg>
10139N/A<arg choice="opt"><option>-version</option></arg>
10139N/A<arg choice="opt" rep="repeat"><option role="nodash"><replaceable>file</replaceable></option></arg>
10139N/A</cmdsynopsis></refsynopsisdiv>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-desc"><title>&desc-tt;</title>
17616N/A<para>
17616N/A<command>&cmd;</command> generates C code marshallers for callback functions
10139N/Aof the GClosure mechanism in the GObject sublibrary of GLib. The marshaller
10139N/Afunctions have a standard signature. The following are passed to the marshaller
10139N/Afunctions: the invoking closure, an array of value structures holding the
10139N/Acallback function parameters, and a value structure for the return value of
10139N/Athe callback. The marshaller then calls the C code function of the closure
17616N/Awith all of the parameters on the stack, and collects the return value.
17616N/A</para>
17616N/A
17616N/A<para>
17616N/A<command>&cmd;</command> generates the specified list of marshallers. The
17616N/Amarshaller list is either read from standard input or from files passed as
17616N/Aadditional arguments on the command line.
17616N/A</para>
10139N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-exde"><title>&exde-tt;</title>
17616N/A<para>
17616N/AThe marshaller lists are processed line by line. A line can contain a comment
17616N/Ain the following format:
17616N/A</para>
17616N/A
17616N/A<para><screen>
17616N/A# this is a comment
17616N/A</screen></para>
17616N/A
17616N/A<para>
17616N/AA marshaller list can contain a marshaller specification in the following
17616N/Aformat:
17616N/A</para>
17616N/A
17616N/A<para><screen>
17616N/A<replaceable>RTYPE</replaceable>:<replaceable>PTYPE</replaceable>
10139N/A<replaceable>RTYPE</replaceable>:<replaceable>PTYPE</replaceable>,<replaceable>
10139N/APTYPE</replaceable>
10139N/A<replaceable>RTYPE</replaceable>:<replaceable>PTYPE</replaceable>,<replaceable>
10139N/APTYPE</replaceable>,<replaceable>PTYPE</replaceable>
17616N/A# up to 16 <replaceable>PTYPE</replaceable>s may be present</screen>
17616N/A</para>
17616N/A
17616N/A<para>
17616N/ARTYPE specifies the callback return type. PTYPE specifies the callback
10139N/Aparameter list, except for the first and the last arguments which are always
17616N/Apointers.
17616N/A</para>
17616N/A
10139N/A<refsect2 id="glib-genmarshal-1-exde-ptyp"><title>Parameter Types</title>
17616N/A<para>
17616N/ACurrently, the following parameter types are supported:
17616N/A</para>
17616N/A
17616N/A<variablelist><varlistentry>
17616N/A<term><literal>BOOL</literal></term>
17616N/A<listitem>
17616N/A<para>
17616N/ADeprecated alias for <literal>BOOLEAN</literal>.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>BOOLEAN</literal></term>
17616N/A<listitem><para>
17616N/ABoolean type (<literal>gboolean</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>BOXED</literal></term>
17616N/A<listitem><para>
17616N/ABoxed, anonymous but reference counted, type (<literal>GBoxed*</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>CHAR</literal></term>
17616N/A<listitem><para>
17616N/ASigned char type (<literal>gchar</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>DOUBLE</literal></term>
17616N/A<listitem><para>
17616N/ADouble-precision float type (<literal>gdouble</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>ENUM</literal></term>
17616N/A<listitem><para>
17616N/AEnumeration type (<literal>gint</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>FLAGS</literal></term>
17616N/A<listitem><para>
17616N/AFlag enumeration type (<literal>guint</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>FLOAT</literal></term>
17616N/A<listitem><para>
17616N/ASingle-precision float type (<literal>gfloat</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>INT</literal></term>
17616N/A<listitem><para>
17616N/ASigned integer type (<literal>gint</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>INT64</literal></term>
17616N/A<listitem><para>
17616N/ASigned 64bit integer type (<literal>gint64</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>LONG</literal></term>
17616N/A<listitem><para>
17616N/ASigned long integer type (<literal>glong</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>NONE</literal></term>
17616N/A<listitem><para>
17616N/ADeprecated alias for <literal>VOID</literal>.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>OBJECT</literal></term>
17616N/A<listitem><para>
17616N/AGObject or derived type (<literal>GObject*</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>PARAM</literal></term>
17616N/A<listitem><para>
17616N/AGParamSpec or derived type (<literal>GParamSpec*</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>POINTER</literal></term>
17616N/A<listitem><para>
17616N/AAnonymous pointer type (<literal>gpointer</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>STRING</literal></term>
17616N/A<listitem><para>
17616N/AString type (<literal>gchar*</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>UCHAR</literal></term>
17616N/A<listitem><para>
17616N/AUnsigned char type (<literal>guchar</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>UINT</literal></term>
17616N/A<listitem><para>
17616N/AUnsigned integer type (<literal>guint</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>UINT64</literal></term>
17616N/A<listitem><para>
17616N/AUnsigned 64bit integer type (<literal>guint64</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>ULONG</literal></term>
17616N/A<listitem><para>
17616N/AUnsigned long integer type (<literal>gulong</literal>).
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><literal>VOID</literal></term>
17616N/A<listitem><para>
17616N/ANo return type, or no extra parameters. If <literal>VOID</literal> is used as
17616N/Athe parameter list, no additional parameters may be present.
17616N/A</para></listitem></varlistentry>
17616N/A</variablelist>
17616N/A</refsect2>
10139N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-opts"><title>&opts-tt;</title>
17616N/A
17616N/A<para>
17616N/AThe following options are supported:
17616N/A</para>
17616N/A
17616N/A<variablelist termlength="medium"><varlistentry>
17616N/A<term><option>-body</option></term>
17616N/A<listitem><para>
17616N/AGenerate the C code file contents of the marshallers.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-g-fatal-warnings</option></term>
17616N/A<listitem><para>
17616N/AMake warnings fatal, that is, exit immediately once a warning occurs.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-internal</option></term>
17616N/A<listitem><para>
17616N/AMark generated functions as internal by using the G_GNUC_INTERNAL macro.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-header</option></term>
17616N/A<listitem><para>
17616N/AGenerate the header file contents of the marshallers.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option role="nodash">-h</option>, <option>-help</option></term>
17616N/A<listitem><para>
17616N/AShow usage and basic help information.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-nostdinc</option></term>
17616N/A<listitem><para>
17616N/ADo not use the standard marshallers of the GObject library, and skip the
17616N/A<filename>gmarshal.h</filename> include directive in generated header files.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-stdinc</option></term>
17616N/A<listitem><para>
17616N/AUse the standard marshallers of the GObject library, and use the
17616N/A<filename>gmarshal.h</filename> include directive in generated header files.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-prefix=<replaceable>dir</replaceable></option></term>
17616N/A<listitem><para>
17616N/ASpecify the marshaller prefix. The default prefix is
17616N/A<literal>g_cclosure_marshal</literal>.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-skip-source</option></term>
17616N/A<listitem><para>
17616N/ASkip source location remarks in generated comments.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option role="nodash">-v</option>, <option>-version</option></term>
17616N/A<listitem><para>
17616N/AShow version information.
17616N/A</para></listitem></varlistentry>
17616N/A</variablelist>
17616N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-oper"><title>&oper-tt;</title>
17616N/A<para>
17616N/AThe following operands are supported:
17616N/A</para>
17616N/A
17616N/A<variablelist termlength="medium">
17616N/A<varlistentry>
17616N/A<term><option role="nodash"><replaceable>file</replaceable></option></term>
17616N/A<listitem><para>
17616N/ASpecifies the marshaller to be generated.
17616N/A</para></listitem></varlistentry>
17616N/A</variablelist>
17616N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-exam"><title>&exam-tt;</title>
10139N/A<example role="example"><title>Generating Marshallers</title>
17616N/A<para>
17616N/AThis example shows how to generate marshallers for the following callback
17616N/Afunctions:
17616N/A</para>
17616N/A
17616N/A<para><screen>
17616N/Avoid foo (gpointer data1,
10139N/A gpointer data2);
10139N/Avoid bar (gpointer data1,
10139N/A gint param1,
10139N/A gpointer data2);
10139N/Agfloat baz (gpointer data1,
10139N/A gboolean param1,
10139N/A guchar param2,
17616N/A gpointer data2);
17616N/A</screen></para>
17616N/A
17616N/A<para>
17616N/AThe marshaller list is as follows:
17616N/A</para>
17616N/A
17616N/A<screen>
17616N/AVOID:VOID
10139N/AVOID:INT
17616N/AFLOAT:BOOLEAN,UCHAR
17616N/A</screen>
17616N/A
17616N/A<para>
17616N/AThe generated marshallers have the arguments encoded in their function name.
17616N/AFor this particular list, they are as follows:
17616N/A</para>
17616N/A
17616N/A<screen>
17616N/Ag_cclosure_marshal_VOID__VOID()
10139N/Ag_cclosure_marshal_VOID__INT()
17616N/Ag_cclosure_marshal_FLOAT__BOOLEAN_UCHAR()
17616N/A</screen>
17616N/A
17616N/A<para>
17616N/AThe generated marshallers can be used directly for GClosures or can be passed
17616N/Ain as the GSignalCMarshaller c_marshaller; argument upon creation of signals:
17616N/A</para>
17616N/A
17616N/A<screen>
17616N/AGClosure *cc_foo, *cc_bar, *cc_baz;
10139N/A
10139N/Acc_foo = g_cclosure_new (NULL, foo, NULL);
10139N/Ag_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID);
10139N/Acc_bar = g_cclosure_new (NULL, bar, NULL);
10139N/Ag_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT);
10139N/Acc_baz = g_cclosure_new (NULL, baz, NULL);
17616N/Ag_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);
17616N/A</screen>
10139N/A</example>
17616N/A
10139N/A</refsect1>
10139N/A<refsect1 id="glib-genmarshal-1-exit"><title>&exit-tt;</title>
17616N/A<para>
17616N/AThe following exit values are returned:
17616N/A</para>
17616N/A<variablelist termlength="xtranarrow">
17616N/A<varlistentry>
17616N/A<term><returnvalue>0</returnvalue></term>
17616N/A<listitem><para>
17616N/AApplication exited successfully
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><returnvalue>>0</returnvalue></term>
17616N/A<listitem><para>
17616N/AApplication exited with failure
17616N/A</para></listitem></varlistentry>
17616N/A</variablelist>
17616N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-file"><title>&file-tt;</title>
17616N/A<para>
17616N/AThe following files are used by this application:
17616N/A</para>
17616N/A
17616N/A<variablelist termlength="wide"><varlistentry>
17616N/A<term><filename>/usr/bin/&cmd;</filename></term>
17616N/A<listitem><para>
17616N/AThe command-line executable for the application.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><filename>/usr/share/gtk-doc/html/glib</filename></term>
17616N/A<listitem><para>
17616N/ALocation of developer documentation
17616N/A</para></listitem></varlistentry>
17616N/A</variablelist>
17616N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-attr"><title>&attr-tt;</title>
17616N/A<para>
17616N/ASee
17616N/A<olink targetdocent="REFMAN5" localinfo="attributes-5">
17616N/A<citerefentry><refentrytitle>attributes</refentrytitle>
17616N/A<manvolnum>5</manvolnum></citerefentry></olink>
17616N/Afor descriptions of the following attributes:
17616N/A</para>
17616N/A
10139N/A<informaltable frame="all">
17616N/A<tgroup cols="2" colsep="1" rowsep="1">
17616N/A<colspec colname="COLSPEC0" colwidth="1*">
10139N/A<colspec colname="COLSPEC1" colwidth="1*">
10139N/A<thead>
17616N/A<row>
17616N/A<entry align="center" valign="middle">ATTRIBUTE TYPE</entry>
17616N/A<entry align="center" valign="middle">ATTRIBUTE VALUE</entry>
17616N/A</row>
10139N/A</thead>
10139N/A<tbody>
17616N/A<row>
17616N/A<entry><para>Availability</para></entry>
17616N/A<entry><para>SUNWglib2-devel</para></entry>
17616N/A</row>
17616N/A<row>
17616N/A<entry colname="COLSPEC0"><para>Interface stability</para></entry>
17616N/A<entry colname="COLSPEC1"><para>Committed</para></entry>
17616N/A</row>
17616N/A</tbody></tgroup></informaltable>
10139N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-also"><title>&also-tt;</title>
10139N/A<!--Reference to another man page-->
10139N/A<!--Reference to a Help manual-->
10139N/A<!--Reference to a book.-->
10139N/A<para>
10139N/A<citerefentry><refentrytitle>gdk-pixbuf-csource</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gdk-pixbuf-query-loaders</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>glib-gettextize</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>glib-mkenums</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gobject-query</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gtk-query-immodules-2.0</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gtk-update-icon-cache</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>libglib-2.0</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>gnome-interfaces</refentrytitle><manvolnum>5</manvolnum></citerefentry>
10139N/A</para>
10139N/A</refsect1>
17616N/A
10139N/A<refsect1 id="glib-genmarshal-1-note"><title>&note-tt;</title>
17616N/A<para>
17616N/AWritten by Tim Janik.
17616N/AUpdated by Brian Cameron, Sun Microsystems Inc., 2003, 2006.
17616N/A</para>
10139N/A</refsect1>
10139N/A</refentry>