summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2014-02-20 02:35:23 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2014-02-20 02:40:03 +0100
commit6cc9207cbdb1328c746e0899f459bb09d1e3e954 (patch)
treeb73473301bb202ea882c966ffadb3accbeab8ed4 /giscanner/doctemplates
parente70abadf0dd7d5312311926ec5b5130e1933d83b (diff)
downloadgobject-introspection-6cc9207cbdb1328c746e0899f459bb09d1e3e954.tar.gz
doctool/Gjs: some more fixes for structs and unions
Stop pretending we have fields on unions (only methods are supported). Add minimal support (ie, don't crash) to nested structures, that due to how ast works have namespace None (and the transformers hard-depend on that). Uncovered by GLib's GDoubleIEEE754, before I removed union fields. For some reason, RegressTestStructE (anonymous union) has a completely different behavior and generates a weird name, while RegressLikeGnomeKeyringSchema (array of unnamed structs) becomes array(gpointer). Bah, one should have methods anyway...
Diffstat (limited to 'giscanner/doctemplates')
-rw-r--r--giscanner/doctemplates/Gjs/class.tmpl13
1 files changed, 11 insertions, 2 deletions
diff --git a/giscanner/doctemplates/Gjs/class.tmpl b/giscanner/doctemplates/Gjs/class.tmpl
index d8433704..7694d726 100644
--- a/giscanner/doctemplates/Gjs/class.tmpl
+++ b/giscanner/doctemplates/Gjs/class.tmpl
@@ -1,6 +1,8 @@
<%inherit file="/class.tmpl"/>
<%block name="synopsis">
- <synopsis><code>
+ <synopsis>\
+% if node.namespace is not None:
+<code>
const ${namespace.name} = imports.gi.${namespace.name};
let ${formatter.to_lower_camel_case(node.name)} = new ${namespace.name}.${node.name}(\
@@ -18,4 +20,11 @@ let ${formatter.to_lower_camel_case(node.name)} = new ${namespace.name}.${node.n
${formatter.format_gboxed_constructor(node)}\
% endif
);
- </code></synopsis></%block>
+ </code>\
+% else:
+ <p>
+ This structure is inside ${node.parent.namespace.name}.${node.parent.name}
+ and can only be used as a field of that.
+ </p>
+% endif
+</synopsis></%block>