Commit be4fda14 authored by Christian Hergert's avatar Christian Hergert

function: add return value info

parent fb2610a3
...@@ -1001,6 +1001,27 @@ girst_instance_parameter_annotations (GirstInstanceParameter *param) ...@@ -1001,6 +1001,27 @@ girst_instance_parameter_annotations (GirstInstanceParameter *param)
return g_string_free (str, FALSE); return g_string_free (str, FALSE);
} }
gchar *
girst_return_value_annotations (GirstReturnValue *param)
{
const gchar *val;
GString *str;
g_return_val_if_fail (GIRST_IS_RETURN_VALUE (param), NULL);
str = g_string_new (NULL);
if (girst_str_equal0 (girst_return_value_get_nullable (param), "1") ||
girst_str_equal0 (girst_return_value_get_allow_none (param), "1"))
g_string_append (str, " ``nullable``");
if ((val = girst_return_value_get_transfer_ownership (param)) &&
!girst_str_equal0 (val, "none"))
g_string_append_printf (str, " ``transfer %s``", val);
return g_string_free (str, FALSE);
}
gboolean gboolean
girst_parser_object_has_property (GirstParserObject *obj, girst_parser_object_has_property (GirstParserObject *obj,
const gchar *name) const gchar *name)
......
...@@ -83,6 +83,7 @@ gchar *girst_property_type_name (GirstProperty *prop, ...@@ -83,6 +83,7 @@ gchar *girst_property_type_name (GirstProperty *prop,
gchar *girst_property_type_flags (GirstProperty *property); gchar *girst_property_type_flags (GirstProperty *property);
gchar *girst_glib_signal_type_flags (GirstGlibSignal *self); gchar *girst_glib_signal_type_flags (GirstGlibSignal *self);
gchar *girst_return_value_to_c (GirstReturnValue *return_value); gchar *girst_return_value_to_c (GirstReturnValue *return_value);
gchar *girst_return_value_annotations (GirstReturnValue *return_value);
const gchar *girst_parser_object_namespace (GirstParserObject *obj); const gchar *girst_parser_object_namespace (GirstParserObject *obj);
gchar *girst_parser_object_title (GirstParserObject *obj); gchar *girst_parser_object_title (GirstParserObject *obj);
gboolean girst_parser_object_has_property (GirstParserObject *obj, gboolean girst_parser_object_has_property (GirstParserObject *obj,
......
...@@ -35,9 +35,13 @@ ...@@ -35,9 +35,13 @@
{{end}} {{end}}
{{if function.has_child_typed(Girst.ReturnValue)}} {{if function.get_lhs_ctype() != "void"}}
{{Girst.title4("Returns")}} {{Girst.title4("Returns")}}
{{for return_value in function.get_children_typed(Girst.ReturnValue)}}
- {{Girst.clink_full(function.get_lhs_ctype(), function.get_lhs(), "")}}: {{if return_value.annotations()}}{{return_value.annotations()}}: {{end}}{{if return_value.has_child_typed(Girst.Doc)}}{{Girst.one_line(return_value.first_typed(Girst.Doc).inner_text, "c")}}{{end}}
{{end}}
{{end}} {{end}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment