summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 20:41:53 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 20:48:52 -0500
commit911339b844bfe41b404f197924bb92a9060031ee (patch)
treef39e9d197cf4211b80234557b19dc86cbb6bbd2b
parentd1e368a22c8b9a9a7b260f7077142233b1a3e189 (diff)
downloadgobject-introspection-911339b844bfe41b404f197924bb92a9060031ee.tar.gz
doctool: Move signal/vfunc templates to extend function.tmpl
-rw-r--r--giscanner/doctemplates/C/function.tmpl6
-rw-r--r--giscanner/doctemplates/C/signal.tmpl2
-rw-r--r--giscanner/doctemplates/C/vfunc.tmpl20
-rw-r--r--tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page19
-rw-r--r--tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page2
5 files changed, 24 insertions, 25 deletions
diff --git a/giscanner/doctemplates/C/function.tmpl b/giscanner/doctemplates/C/function.tmpl
index 4472ec5f..94036986 100644
--- a/giscanner/doctemplates/C/function.tmpl
+++ b/giscanner/doctemplates/C/function.tmpl
@@ -9,7 +9,7 @@
<api:returns>
<api:type>${formatter.format_type(node.retval.type) | x}</api:type>
</api:returns>
- <api:name>${node.symbol}</api:name>
+ <api:name>${formatter.format_function_name(node)}</api:name>
% for arg in node.all_parameters:
% if arg.type.ctype == '<varargs>':
<api:varargs/>
@@ -24,13 +24,13 @@
</%block>
<%block name="synopsis">
<synopsis><code mime="text/x-csrc">
-${node.retval.type.ctype} ${node.symbol} (\
+${node.retval.type.ctype} ${formatter.format_function_name(node)} (\
% if len(node.all_parameters) == 0:
void\
% else:
% for arg, ix in zip(node.all_parameters, range(len(node.all_parameters))):
% if ix != 0:
-${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\
+${' ' * (len(formatter.format_type(node.retval.type)) + len(formatter.format_function_name(node)) + 3)}\
% endif
% if arg.type.ctype == '<varargs>':
...\
diff --git a/giscanner/doctemplates/C/signal.tmpl b/giscanner/doctemplates/C/signal.tmpl
index e3eb0511..20e28e18 100644
--- a/giscanner/doctemplates/C/signal.tmpl
+++ b/giscanner/doctemplates/C/signal.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="/base.tmpl"/>
+<%inherit file="./function.tmpl"/>
<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
<title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/C/vfunc.tmpl b/giscanner/doctemplates/C/vfunc.tmpl
index 902b8864..85427de8 100644
--- a/giscanner/doctemplates/C/vfunc.tmpl
+++ b/giscanner/doctemplates/C/vfunc.tmpl
@@ -1,22 +1,4 @@
-<%inherit file="/base.tmpl"/>
+<%inherit file="./function.tmpl"/>
<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="vfunc"/>
</%block>
-<%block name="synopsis">
-<synopsis><code mime="text/x-csrc">
-</code></synopsis>
-</%block>
-<%block name="details">
-% if node.parameters or node.retval:
-<dl>
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-<dt><p>${arg.argname} :</p></dt>
-<dd>${formatter.format(node, arg.doc)}</dd>
-% endfor
-% if node.retval:
-<dt><p>Returns :</p></dt>
-<dd>${formatter.format(node, node.retval.doc)}</dd>
-% endif
-</dl>
-% endif
-</%block>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
index 5b54651a..8502865c 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
@@ -13,7 +13,12 @@
</info>
<title>DocExamples.Obj::signal-example</title>
-
+<synopsis><code mime="text/x-csrc">
+void signal-example (guint int_param,
+ guint float_param,
+ gpointer pointer_param);
+</code></synopsis>
+
<p>This is an example of how to document a signal.</p>
@@ -21,7 +26,17 @@
<p>Since 0.99</p>
-
+<dl>
+<dt><p>int_param :</p></dt>
+<dd><p>a parameter of type int</p></dd>
+<dt><p>float_param :</p></dt>
+<dd><p>a parameter of type float</p></dd>
+<dt><p>pointer_param :</p></dt>
+<dd><p>A pointer to @obj's thingy -- pass <code>int_param</code> if you really want to.</p></dd>
+<dt><p>Returns :</p></dt>
+<dd></dd>
+</dl>
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
index c06c5e7a..6a71a87c 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
@@ -13,6 +13,8 @@
<title>DocExamples.Obj::vfunc</title>
<synopsis><code mime="text/x-csrc">
+void vfunc (DocExamplesObj* self,
+ gint first_arg);
</code></synopsis>