| 1 |
<%inherit file="/class.tmpl"/> |
| 2 |
<%block name="synopsis"> |
| 3 |
<synopsis>\ |
| 4 |
% if node.namespace is not None: |
| 5 |
<code> |
| 6 |
import ${namespace.name} from 'gi://${namespace.name}'; |
| 7 |
|
| 8 |
let ${formatter.to_lower_camel_case(node.name)} = new ${namespace.name}.${node.name}(\ |
| 9 |
% if isinstance(node, (ast.Class, ast.Interface)): |
| 10 |
% if len(node.properties) > 0: |
| 11 |
{ |
| 12 |
% for ix, property_ in enumerate(node.properties): |
| 13 |
% if (property_.construct or property_.construct_only) and property_.writable: |
| 14 |
<link xref='${namespace.name}.${node.name}-${property_.name}'>${property_.name.replace('-', '_')}</link>: value, |
| 15 |
% endif |
| 16 |
% endfor |
| 17 |
}\ |
| 18 |
% endif |
| 19 |
% else: |
| 20 |
${formatter.format_gboxed_constructor(node)}\ |
| 21 |
% endif |
| 22 |
); |
| 23 |
</code>\ |
| 24 |
% else: |
| 25 |
<p> |
| 26 |
This structure is inside ${node.parent.namespace.name}.${node.parent.name} |
| 27 |
and can only be used as a field of that. |
| 28 |
</p> |
| 29 |
% endif |
| 30 |
</synopsis></%block> |