[gi-docgen/missing-args-refactor] template: Add missing callables from the arguments refactor




commit 091001558653e31709b34bdfe7f45eacb9b25fc2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon May 24 14:29:22 2021 +0100

    template: Add missing callables from the arguments refactor
    
    Constructors, type functions, and signals are all callables and they
    should have the same layout as methods, functions, and virtual
    functions.

 gidocgen/templates/basic/ctor.html      | 51 ++++++++++++++++++++------------
 gidocgen/templates/basic/signal.html    | 52 +++++++++++++++++++++------------
 gidocgen/templates/basic/type_func.html | 51 ++++++++++++++++++++------------
 3 files changed, 98 insertions(+), 56 deletions(-)
---
diff --git a/gidocgen/templates/basic/ctor.html b/gidocgen/templates/basic/ctor.html
index 9161f85..a45db21 100644
--- a/gidocgen/templates/basic/ctor.html
+++ b/gidocgen/templates/basic/ctor.html
@@ -101,14 +101,14 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="arguments">
           {% for arg in type_func.arguments %}
           <tr class="arg-name">
             <td><code>{{ arg.name }}</code></td>
             <td>
-            {%- if arg.link -%}
             {%- if arg.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if arg.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if arg.link -%}
             {{ arg.link|safe }}
             {%- else -%}
             <code>{{ arg.type_cname }}</code>
@@ -117,17 +117,28 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           <tr class="arg-description">
             <td>&nbsp;</td>
-            <td>{{ arg.description }}</td>
+            <td>{{ arg.description|safe }}</td>
           </tr>
-          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td>Direction: {{ arg.direction }}</td></tr>{% 
endif %}
-          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.optional %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code> terminated</td></tr>{% endif %}
-          {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements</td></tr>{% endif %}
-          {% if arg.is_array and arg.len_arg %}<tr><td>&nbsp;</td><td>The length of the array is in the 
<code>{{ arg.len_arg }}</code> argument</td></tr>{% endif %}
+          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
+          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction == "out" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be set to <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
+          {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
+          {% if arg.is_array and arg.len_arg %}<tr><td>&nbsp;</td><td>The length of the array is specified 
in the <code>{{ arg.len_arg }}</code> argument.</td></tr>{% endif %}
           {% 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 type_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>
@@ -141,12 +152,13 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="returns">
           <tr class="arg-name">
-            <td colspan="2">Returns:&nbsp;
-            {%- if type_func.return_value.link -%}
+            <td>Returns:</td>
+            <td>
             {%- if type_func.return_value.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if type_func.return_value.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if type_func.return_value.link -%}
             {{ type_func.return_value.link|safe }}
             {%- else -%}
             <code>{{ type_func.return_value.type_cname }}</code>
@@ -154,14 +166,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
             </td>
           </tr>
           <tr class="arg-description">
-            <td colspan="2">{{ type_func.return_value.description }}</td>
+            <td>&nbsp;</td>
+            <td>{{ type_func.return_value.description|safe }}</td>
           </tr>
-          {% if type_func.return_value.is_array and type_func.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array must be <code>NULL</code> terminated</td></tr>{% endif %}
-          {% if type_func.return_value.is_array and type_func.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array must have {{ type_func.return_value.fixed_size }} elements</td></tr>{% 
endif %}
-          {% if type_func.return_value.is_array and type_func.return_value.len_arg 
%}<tr><td>&nbsp;</td><td>The length of the array is in the <code>{{ type_func.return_value.len_arg }}</code> 
argument</td></tr>{% endif %}
-          {% if type_func.return_value.is_pointer %}<tr><td title="transfer: {{ 
type_func.return_value.transfer }}">{{ type_func.return_value.transfer_note }}</td></tr>{% endif %}
-          {% if type_func.return_value.is_pointer and type_func.return_value.nullable %}<tr><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if type_func.return_value.string_note %}<tr><td>{{ type_func.return_value.string_note 
}}</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array is <code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array has {{ type_func.return_value.fixed_size }} elements.</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.len_arg 
%}<tr><td>&nbsp;</td><td>The length of the array is in the <code>{{ type_func.return_value.len_arg }}</code> 
argument.</td></tr>{% endif %}
+          {% if type_func.return_value.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ 
type_func.return_value.transfer }}">{{ type_func.return_value.transfer_note }}</td></tr>{% endif %}
+          {% if type_func.return_value.is_pointer and type_func.return_value.nullable 
%}<tr><td>&nbsp;</td><td>The return value can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if type_func.return_value.string_note %}<tr><td>&nbsp;</td><td>{{ 
type_func.return_value.string_note }}</td></tr>{% endif %}
         </table>
       </div>
     </div>
diff --git a/gidocgen/templates/basic/signal.html b/gidocgen/templates/basic/signal.html
index 6319dc2..ea27925 100644
--- a/gidocgen/templates/basic/signal.html
+++ b/gidocgen/templates/basic/signal.html
@@ -111,30 +111,44 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="arguments">
           {% for arg in signal.arguments %}
-          <tr>
+          <tr class="arg-name">
             <td><code>{{ arg.name }}</code></td>
             <td>
-            {%- if arg.link -%}
             {%- if arg.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if arg.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if arg.link -%}
             {{ arg.link|safe }}
             {%- else -%}
             <code>{{ arg.type_cname }}</code>
             {%- endif -%}
             </td>
           </tr>
-          <tr>
+          <tr class="arg-description">
             <td>&nbsp;</td>
-            <td>{{ arg.description }}</td>
+            <td>{{ arg.description|safe }}</td>
           </tr>
-          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td>Direction: {{ arg.direction }}</td></tr>{% 
endif %}
-          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.optional %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
+          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
+          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction == "out" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be set to <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
+          {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
+          {% if arg.is_array and arg.len_arg %}<tr><td>&nbsp;</td><td>The length of the array is specified 
in the <code>{{ arg.len_arg }}</code> argument.</td></tr>{% endif %}
           {% 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 signal.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>
@@ -148,12 +162,13 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="returns">
           <tr class="arg-name">
-            <td colspan="2">Returns:&nbsp;
-            {%- if signal.return_value.link -%}
+            <td>Returns:</td>
+            <td>
             {%- if signal.return_value.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if signal.return_value.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if signal.return_value.link -%}
             {{ signal.return_value.link|safe }}
             {%- else -%}
             <code>{{ signal.return_value.type_cname }}</code>
@@ -161,14 +176,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
             </td>
           </tr>
           <tr class="arg-description">
-            <td colspan="2">{{ signal.return_value.description }}</td>
+            <td>&nbsp;</td>
+            <td>{{ signal.return_value.description|safe }}</td>
           </tr>
-          {% if signal.return_value.is_array and signal.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array must be <code>NULL</code> terminated</td></tr>{% endif %}
-          {% if signal.return_value.is_array and signal.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array must have {{ signal.return_value.fixed_size }} elements</td></tr>{% endif 
%}
-          {% if signal.return_value.is_array and signal.return_value.len_arg %}<tr><td>&nbsp;</td><td>The 
length of the array is in the <code>{{ signal.return_value.len_arg }}</code> argument</td></tr>{% endif %}
-          {% if signal.return_value.is_pointer %}<tr><td title="transfer: {{ signal.return_value.transfer 
}}">{{ signal.return_value.transfer_note }}</td></tr>{% endif %}
-          {% if signal.return_value.is_pointer and signal.return_value.nullable %}<tr><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if signal.return_value.string_note %}<tr><td>{{ signal.return_value.string_note }}</td></tr>{% 
endif %}
+          {% if signal.return_value.is_array and signal.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array is <code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if signal.return_value.is_array and signal.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array has {{ signal.return_value.fixed_size }} elements.</td></tr>{% endif %}
+          {% if signal.return_value.is_array and signal.return_value.len_arg %}<tr><td>&nbsp;</td><td>The 
length of the array is in the <code>{{ signal.return_value.len_arg }}</code> argument.</td></tr>{% endif %}
+          {% if signal.return_value.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ 
signal.return_value.transfer }}">{{ signal.return_value.transfer_note }}</td></tr>{% endif %}
+          {% if signal.return_value.is_pointer and signal.return_value.nullable %}<tr><td>&nbsp;</td><td>The 
return value can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if signal.return_value.string_note %}<tr><td>&nbsp;</td><td>{{ signal.return_value.string_note 
}}</td></tr>{% endif %}
         </table>
       </div>
     </div>
diff --git a/gidocgen/templates/basic/type_func.html b/gidocgen/templates/basic/type_func.html
index 360ced7..babde7a 100644
--- a/gidocgen/templates/basic/type_func.html
+++ b/gidocgen/templates/basic/type_func.html
@@ -101,14 +101,14 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="arguments">
           {% for arg in type_func.arguments %}
           <tr class="arg-name">
             <td><code>{{ arg.name }}</code></td>
             <td>
-            {%- if arg.link -%}
             {%- if arg.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if arg.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if arg.link -%}
             {{ arg.link|safe }}
             {%- else -%}
             <code>{{ arg.type_cname }}</code>
@@ -117,17 +117,28 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           <tr class="arg-description">
             <td>&nbsp;</td>
-            <td>{{ arg.description }}</td>
+            <td>{{ arg.description|safe }}</td>
           </tr>
-          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td>Direction: {{ arg.direction }}</td></tr>{% 
endif %}
-          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.optional %}<tr><td>&nbsp;</td><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code> terminated</td></tr>{% endif %}
-          {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements</td></tr>{% endif %}
-          {% if arg.is_array and arg.len_arg %}<tr><td>&nbsp;</td><td>The length of the array is in the 
<code>{{ arg.len_arg }}</code> argument</td></tr>{% endif %}
+          {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
+          {% if arg.direction == "in" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction == "out" and arg.is_pointer and arg.nullable %}<tr><td>&nbsp;</td><td>The 
argument can be set to <code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
+          {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
+          {% if arg.is_array and arg.len_arg %}<tr><td>&nbsp;</td><td>The length of the array is specified 
in the <code>{{ arg.len_arg }}</code> argument.</td></tr>{% endif %}
           {% 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 type_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>
@@ -141,12 +152,13 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </h4>
 
       <div class="docblock">
-        <table>
+        <table class="returns">
           <tr class="arg-name">
-            <td colspan="2">Returns:&nbsp;
-            {%- if type_func.return_value.link -%}
+            <td>Returns:</td>
+            <td>
             {%- if type_func.return_value.is_array -%}An array of&nbsp;{%- endif -%}
             {%- if type_func.return_value.is_list -%}A list of&nbsp;{%- endif -%}
+            {%- if type_func.return_value.link -%}
             {{ type_func.return_value.link|safe }}
             {%- else -%}
             <code>{{ type_func.return_value.type_cname }}</code>
@@ -154,14 +166,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
             </td>
           </tr>
           <tr class="arg-description">
-            <td colspan="2">{{ type_func.return_value.description }}</td>
+            <td>&nbsp;</td>
+            <td>{{ type_func.return_value.description|safe }}</td>
           </tr>
-          {% if type_func.return_value.is_array and type_func.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array must be <code>NULL</code> terminated</td></tr>{% endif %}
-          {% if type_func.return_value.is_array and type_func.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array must have {{ type_func.return_value.fixed_size }} elements</td></tr>{% 
endif %}
-          {% if type_func.return_value.is_array and type_func.return_value.len_arg 
%}<tr><td>&nbsp;</td><td>The length of the array is in the <code>{{ type_func.return_value.len_arg }}</code> 
argument</td></tr>{% endif %}
-          {% if type_func.return_value.is_pointer %}<tr><td title="transfer: {{ 
type_func.return_value.transfer }}">{{ type_func.return_value.transfer_note }}</td></tr>{% endif %}
-          {% if type_func.return_value.is_pointer and type_func.return_value.nullable %}<tr><td>Can be 
<code>NULL</code></td></tr>{% endif %}
-          {% if type_func.return_value.string_note %}<tr><td>{{ type_func.return_value.string_note 
}}</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.zero_terminated 
%}<tr><td>&nbsp;</td><td>The array is <code>NULL</code>-terminated.</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.fixed_size > 0 
%}<tr><td>&nbsp;</td><td>The array has {{ type_func.return_value.fixed_size }} elements.</td></tr>{% endif %}
+          {% if type_func.return_value.is_array and type_func.return_value.len_arg 
%}<tr><td>&nbsp;</td><td>The length of the array is in the <code>{{ type_func.return_value.len_arg }}</code> 
argument.</td></tr>{% endif %}
+          {% if type_func.return_value.is_pointer %}<tr><td>&nbsp;</td><td title="transfer: {{ 
type_func.return_value.transfer }}">{{ type_func.return_value.transfer_note }}</td></tr>{% endif %}
+          {% if type_func.return_value.is_pointer and type_func.return_value.nullable 
%}<tr><td>&nbsp;</td><td>The return value can be <code>NULL</code>.</td></tr>{% endif %}
+          {% if type_func.return_value.string_note %}<tr><td>&nbsp;</td><td>{{ 
type_func.return_value.string_note }}</td></tr>{% endif %}
         </table>
       </div>
     </div>


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