[gobject-introspection] g-ir-doc-tool: Add a method in the tests



commit 0212b33e933999b4d03858cce503c602c5a05908
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date:   Tue Feb 21 17:17:17 2012 +0100

    g-ir-doc-tool: Add a method in the tests

 .../DocExamples.Obj.method.page                    |   53 ++++++++++++++++++++
 .../DocExamples.Obj.method.page                    |   49 ++++++++++++++++++
 tests/doctool/doc-examples-obj.c                   |   15 ++++++
 tests/doctool/doc-examples-obj.h                   |    4 +-
 4 files changed, 118 insertions(+), 3 deletions(-)
---
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
new file mode 100644
index 0000000..f6c2eba
--- /dev/null
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+
+<page id="DocExamples.Obj.method"
+      type="topic"
+      style="method"
+      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="method"/>
+    <api:function>
+      <api:returns>
+        <api:type>void</api:type>
+      </api:returns>
+      <api:name>doc_examples_obj_method</api:name>
+      <api:arg>
+        <api:type>DocExamplesObj *</api:type>
+        <api:name>self</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gint</api:type>
+        <api:name>first_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gfloat</api:type>
+        <api:name>second_arg</api:name>
+      </api:arg>
+    </api:function>
+  </info>
+  <title>doc_examples_obj_method</title>
+<synopsis><code mime="text/x-csrc">
+void doc_examples_obj_method (DocExamplesObj *self,
+gint first_arg,
+                              gfloat second_arg);
+</code></synopsis>
+<p>This is an example of how to document a method.</p>
+
+<table>
+<tr>
+<td><p>first_arg :</p></td>
+<td><p>first argument</p></td>
+</tr>
+<tr>
+<td><p>second_arg :</p></td>
+<td><p>second argument</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td></td>
+</tr>
+</table>
+<p>Since 0.99</p>
+</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
new file mode 100644
index 0000000..9f7e496
--- /dev/null
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+
+<page id="DocExamples.Obj.method"
+      type="topic"
+      style="method"
+      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="method"/>
+    <api:function>
+      <api:returns>
+        <api:type>none</api:type>
+      </api:returns>
+      <api:name>doc_examples_obj_method</api:name>
+      <api:arg>
+        <api:type>DocExamplesObj *</api:type>
+        <api:name>self</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gint</api:type>
+        <api:name>first_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gfloat</api:type>
+        <api:name>second_arg</api:name>
+      </api:arg>
+    </api:function>
+  </info>
+  <title>method</title>
+<synopsis><code mime="text/x-python">
+ accepts(gint, gfloat)
+ returns(none)
+def method(first_arg, second_arg)
+</code></synopsis>
+<p>This is an example of how to document a method.</p>
+
+<table>
+<tr>
+<td><p>first_arg :</p></td>
+<td><p>first argument</p></td>
+</tr>
+<tr>
+<td><p>second_arg :</p></td>
+<td><p>second argument</p></td>
+</tr>
+</table>
+<p>Since 0.99</p>
+</page>
diff --git a/tests/doctool/doc-examples-obj.c b/tests/doctool/doc-examples-obj.c
index 30f4d1d..0839f1c 100644
--- a/tests/doctool/doc-examples-obj.c
+++ b/tests/doctool/doc-examples-obj.c
@@ -99,3 +99,18 @@ doc_examples_obj_new (void)
 {
   return g_object_new (DOC_EXAMPLES_TYPE_OBJ, NULL);
 }
+
+/**
+ * doc_examples_obj_method:
+ * @first_arg: first argument
+ * @second_arg: second argument
+ *
+ * This is an example of how to document a method.
+ *
+ * Since: 0.99
+ */
+void
+doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg)
+{
+
+}
diff --git a/tests/doctool/doc-examples-obj.h b/tests/doctool/doc-examples-obj.h
index a4437cb..46db806 100644
--- a/tests/doctool/doc-examples-obj.h
+++ b/tests/doctool/doc-examples-obj.h
@@ -32,12 +32,9 @@ G_BEGIN_DECLS
 typedef struct _DocExamplesObj DocExamplesObj;
 typedef struct _DocExamplesObjClass DocExamplesObjClass;
 
-
 struct _DocExamplesObj
 {
   GObject parent;
-
-
 };
 
 struct _DocExamplesObjClass
@@ -48,6 +45,7 @@ struct _DocExamplesObjClass
 GType doc_examples_obj_get_type (void) G_GNUC_CONST;
 
 DocExamplesObj *doc_examples_obj_new (void);
+void doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]