--- /dev/null
+<?xml version="1.0"?>
+<page id="DocExamples.Callback"
+ type="topic"
+ style=""
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ </info>
+ <title>DocExamples.Callback</title>
+
+</page>
--- /dev/null
+<?xml version="1.0"?>
+<page id="DocExamples.Enum"
+ type="guide"
+ style="enum"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index"/>
+ </info>
+ <title>DocExamples.Enum</title>
+<p>This is an example to document an enumeration.</p>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.Obj.static_method"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="DocExamples.Obj" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>gboolean</api:type>
+ </api:returns>
+ <api:name>doc_examples_obj_static_method</api:name>
+ <api:arg>
+ <api:type>gint*</api:type>
+ <api:name>out_arg</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>doc_examples_obj_static_method</title>
+<synopsis><code mime="text/x-csrc">
+gboolean doc_examples_obj_static_method (gint* out_arg);
+</code></synopsis>
+<p>This is an example of a function with an out argument
+and a return value.</p>
+
+<table>
+<tr>
+<td><p>out_arg :</p></td>
+<td><p>a pointer to int, or NULL to ignore</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td><p>TRUE if @out_arg is valid, FALSE otherwise</p></td>
+</tr>
+</table>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.array_function"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>gint*</api:type>
+ </api:returns>
+ <api:name>doc_examples_array_function</api:name>
+ <api:arg>
+ <api:type>gint*</api:type>
+ <api:name>out_len</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>doc_examples_array_function</title>
+<synopsis><code mime="text/x-csrc">
+gint* doc_examples_array_function (gint* out_len);
+</code></synopsis>
+<p>This function returns an array with an explicit length,
+and the length should be invisible in most introspected bindings.</p>
+
+<table>
+<tr>
+<td><p>out_len :</p></td>
+<td><p>the length of the returned array</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td><p>an array of numbers.</p></td>
+</tr>
+</table>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.callback_function"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>void</api:type>
+ </api:returns>
+ <api:name>doc_examples_callback_function</api:name>
+ <api:arg>
+ <api:type>DocExamplesCallback</api:type>
+ <api:name>callback</api:name>
+ </api:arg>
+ <api:arg>
+ <api:type>gpointer</api:type>
+ <api:name>user_data</api:name>
+ </api:arg>
+ <api:arg>
+ <api:type>GDestroyNotify</api:type>
+ <api:name>destroy_notify</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>doc_examples_callback_function</title>
+<synopsis><code mime="text/x-csrc">
+void doc_examples_callback_function (DocExamplesCallback callback,
+ gpointer user_data,
+ GDestroyNotify destroy_notify);
+</code></synopsis>
+<p>This is a function that takes a callback. Different languages
+will expose this in different ways (e.g. Python keeps the
+@user_data parameter, while JS doesn't)</p>
+
+<table>
+<tr>
+<td><p>callback :</p></td>
+<td><p>Just Call Me Maybe</p></td>
+</tr>
+<tr>
+<td><p>user_data :</p></td>
+<td><p>your stuff</p></td>
+</tr>
+<tr>
+<td><p>destroy_notify :</p></td>
+<td><p>how to get rid of @user_data</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td></td>
+</tr>
+</table>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+<page id="DocExamples.Callback"
+ type="topic"
+ style=""
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ </info>
+ <title>DocExamples.Callback</title>
+
+</page>
--- /dev/null
+<?xml version="1.0"?>
+<page id="DocExamples.Enum"
+ type="guide"
+ style="enum"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index"/>
+ </info>
+ <title>DocExamples.Enum</title>
+ <p>This is an example to document an enumeration.</p>
+<table>
+<tr>
+<td><p>Enum.FOO :</p></td>
+<td><p>a foo</p></td>
+</tr>
+<tr>
+<td><p>Enum.BAR :</p></td>
+<td><p>a bar</p></td>
+</tr>
+</table>
+
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.Obj.static_method"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="DocExamples.Obj" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>gboolean</api:type>
+ </api:returns>
+ <api:name>doc_examples_obj_static_method</api:name>
+ <api:arg>
+ <api:type>gint</api:type>
+ <api:name>out_arg</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>static_method</title>
+<synopsis><code mime="text/x-python">
+@accepts(gint)
+@returns(gboolean)
+def static_method(out_arg)
+</code></synopsis>
+<p>This is an example of a function with an out argument
+and a return value.</p>
+
+<table>
+<tr>
+<td><p>out_arg :</p></td>
+<td><p>a pointer to int, or None to ignore</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td><p>True if @out_arg is valid, False otherwise</p></td>
+</tr>
+</table>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.array_function"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>[gint]</api:type>
+ </api:returns>
+ <api:name>doc_examples_array_function</api:name>
+ <api:arg>
+ <api:type>gint</api:type>
+ <api:name>out_len</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>array_function</title>
+<synopsis><code mime="text/x-python">
+@accepts(gint)
+@returns([gint])
+def array_function(out_len)
+</code></synopsis>
+<p>This function returns an array with an explicit length,
+and the length should be invisible in most introspected bindings.</p>
+
+<table>
+<tr>
+<td><p>out_len :</p></td>
+<td><p>the length of the returned array</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td><p>an array of numbers.</p></td>
+</tr>
+</table>
+</page>
--- /dev/null
+<?xml version="1.0"?>
+
+<page id="DocExamples.callback_function"
+ type="topic"
+ style="function"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <link type="guide" xref="index" group="function"/>
+ <api:function>
+ <api:returns>
+ <api:type>none</api:type>
+ </api:returns>
+ <api:name>doc_examples_callback_function</api:name>
+ <api:arg>
+ <api:type>DocExamples.Callback</api:type>
+ <api:name>callback</api:name>
+ </api:arg>
+ <api:arg>
+ <api:type>gpointer</api:type>
+ <api:name>user_data</api:name>
+ </api:arg>
+ <api:arg>
+ <api:type>GLib.DestroyNotify</api:type>
+ <api:name>destroy_notify</api:name>
+ </api:arg>
+ </api:function>
+ </info>
+ <title>callback_function</title>
+<synopsis><code mime="text/x-python">
+@accepts(DocExamples.Callback, gpointer, GLib.DestroyNotify)
+@returns(none)
+def callback_function(callback, user_data, destroy_notify)
+</code></synopsis>
+<p>This is a function that takes a callback. Different languages
+will expose this in different ways (e.g. Python keeps the
+@user_data parameter, while JS doesn't)</p>
+
+<table>
+<tr>
+<td><p>callback :</p></td>
+<td><p>Just Call Me Maybe</p></td>
+</tr>
+<tr>
+<td><p>user_data :</p></td>
+<td><p>your stuff</p></td>
+</tr>
+<tr>
+<td><p>destroy_notify :</p></td>
+<td><p>how to get rid of @user_data</p></td>
+</tr>
+</table>
+</page>
{
return FALSE;
}
+
+/**
+ * doc_examples_obj_static_method:
+ * @out_arg: (out) (allow-none): a pointer to int, or %NULL to ignore
+ *
+ * This is an example of a function with an out argument
+ * and a return value.
+ *
+ * Returns: %TRUE if @out_arg is valid, %FALSE otherwise
+ */
+gboolean
+doc_examples_obj_static_method (gint *out_arg)
+{
+ if (out_arg)
+ *out_arg = 42;
+
+ return TRUE;
+}
+
+/**
+ * doc_examples_array_function:
+ * @out_len: (out): the length of the returned array
+ *
+ * This function returns an array with an explicit length,
+ * and the length should be invisible in most introspected bindings.
+ *
+ * Returns: (array length=out_len) (transfer full): an array of numbers.
+ */
+gint *
+doc_examples_array_function (gint *out_len)
+{
+ gint *array;
+ int i, n = 3;
+
+ array = g_new(int, n);
+ for (i = 0; i < n; i++)
+ array[i] = i;
+
+ *out_len = n;
+ return array;
+}
+
+/**
+ * doc_examples_callback_function:
+ * @callback: Just Call Me Maybe
+ * @user_data: your stuff
+ * @destroy_notify: how to get rid of @user_data
+ *
+ * This is a function that takes a callback. Different languages
+ * will expose this in different ways (e.g. Python keeps the
+ * @user_data parameter, while JS doesn't)
+ */
+void
+doc_examples_callback_function (DocExamplesCallback callback,
+ gpointer user_data,
+ GDestroyNotify destroy_notify)
+{
+ gchar *result;
+
+ result = callback (42, 17);
+ g_free (result);
+
+ if (user_data && destroy_notify)
+ destroy_notify (user_data);
+}
gboolean doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg,
gboolean boolean_arg, gpointer pointer_arg, gchar *string);
+gboolean doc_examples_obj_static_method (gint *out_arg);
+
+gint *doc_examples_array_function (gint *out_len);
+
+/**
+ * DocExamplesEnum:
+ * @DOC_EXAMPLES_FOO: a foo
+ * @DOC_EXAMPLES_BAR: a bar
+ *
+ * This is an example to document an enumeration.
+ */
+typedef enum {
+ DOC_EXAMPLES_FOO,
+ DOC_EXAMPLES_BAR
+} DocExamplesEnum;
+
+/**
+ * DocExamplesCallback:
+ * @one: first parameter
+ * @two: second parameter
+ *
+ * Returns: something
+ */
+typedef gchar * (*DocExamplesCallback) (int one, int two);
+
+void doc_examples_callback_function (DocExamplesCallback callback,
+ gpointer user_data,
+ GDestroyNotify destroy_notify);
+
G_END_DECLS
#endif /* _DOC_EXAMPLES_OBJ_H */