[gi-docgen/ebassi/argument-annotation: 4/8] Generate GError argument description




commit 2d41987264c240636fac3778d2df3b225e3aa61b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri May 21 13:13:55 2021 +0100

    Generate GError argument description
    
    The introspection data turns GError** arguments into a `throws`
    attribute. We already add the argument when generating the declaration
    of a method or function, so we also need to generate the corresponding
    argument description.
    
    Fixes: #86

 gidocgen/templates/basic/class_method.html | 10 ++++++++++
 gidocgen/templates/basic/function.html     | 10 ++++++++++
 gidocgen/templates/basic/method.html       | 10 ++++++++++
 3 files changed, 30 insertions(+)
---
diff --git a/gidocgen/templates/basic/class_method.html b/gidocgen/templates/basic/class_method.html
index 3be5273..222bb18 100644
--- a/gidocgen/templates/basic/class_method.html
+++ b/gidocgen/templates/basic/class_method.html
@@ -126,6 +126,16 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           {% if arg.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ arg.transfer }}">{{ 
arg.transfer_note }}</td></tr>{% endif %}
           {% if arg.string_note %}<tr><td>&nbsp;</td><td>{{ arg.string_note }}</td></tr>{% endif %}
           {% endfor %}
+          {% if class_method.throws %}
+          <tr class="arg-name">
+            <td><code>error</code></td>
+            <td><code>GError **</code></td>
+          </tr>
+          <tr class="arg-description">
+            <td>&nbsp;</td>
+            <td>The return location for a <code>GError*</code>, or <code>NULL</code>.</td>
+          </tr>
+          {% endif %}
         </table>
       </div>
     </div>
diff --git a/gidocgen/templates/basic/function.html b/gidocgen/templates/basic/function.html
index b676726..367ae68 100644
--- a/gidocgen/templates/basic/function.html
+++ b/gidocgen/templates/basic/function.html
@@ -135,6 +135,16 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           {% if arg.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ arg.transfer }}">{{ 
arg.transfer_note }}</td></tr>{% endif %}
           {% if arg.string_note %}<tr><td>&nbsp;</td><td>{{ arg.string_note }}</td></tr>{% endif %}
           {% endfor %}
+          {% if func.throws %}
+          <tr class="arg-name">
+            <td><code>error</code></td>
+            <td><code>GError **</code></td>
+          </tr>
+          <tr class="arg-description">
+            <td>&nbsp;</td>
+            <td>The return location for a <code>GError*</code>, or <code>NULL</code>.</td>
+          </tr>
+          {% endif %}
         </table>
       </div>
     </div>
diff --git a/gidocgen/templates/basic/method.html b/gidocgen/templates/basic/method.html
index 435ee3a..ba6a9c6 100644
--- a/gidocgen/templates/basic/method.html
+++ b/gidocgen/templates/basic/method.html
@@ -128,6 +128,16 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           {% if arg.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ arg.transfer }}">{{ 
arg.transfer_note }}</td></tr>{% endif %}
           {% if arg.string_note %}<tr><td>&nbsp;</td><td>{{ arg.string_note }}</td></tr>{% endif %}
           {% endfor %}
+          {% if method.throws %}
+          <tr class="arg-name">
+            <td><code>error</code></td>
+            <td><code>GError **</code></td>
+          </tr>
+          <tr class="arg-description">
+            <td>&nbsp;</td>
+            <td>The return location for a <code>GError*</code>, or <code>NULL</code>.</td>
+          </tr>
+          {% endif %}
         </table>
       </div>
     </div>


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