diff options
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/ast.py | 1 | ||||
-rw-r--r-- | giscanner/gdumpparser.py | 7 | ||||
-rw-r--r-- | giscanner/girparser.py | 1 | ||||
-rw-r--r-- | giscanner/girwriter.py | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 2cfd81fc..dac326cb 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -1304,6 +1304,7 @@ class Property(Node): self.transfer = transfer self.setter = None self.getter = None + self.default_value = None self.parent = None # A Class or Interface diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py index 1a0794d4..21fbadf4 100644 --- a/giscanner/gdumpparser.py +++ b/giscanner/gdumpparser.py @@ -414,10 +414,13 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide writable = (flags & G_PARAM_WRITABLE) != 0 construct = (flags & G_PARAM_CONSTRUCT) != 0 construct_only = (flags & G_PARAM_CONSTRUCT_ONLY) != 0 - node.properties.append(ast.Property( + default_value = pspec.attrib['default-value'] + prop = ast.Property( pspec.attrib['name'], ast.Type.create_from_gtype_name(ctype), - readable, writable, construct, construct_only)) + readable, writable, construct, construct_only) + prop.default_value = default_value + node.properties.append(prop) node.properties = node.properties def _introspect_signals(self, node, xmlnode): diff --git a/giscanner/girparser.py b/giscanner/girparser.py index edaaa992..5fc22899 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -609,6 +609,7 @@ class GIRParser(object): node.attrib.get('transfer-ownership')) prop.setter = node.attrib.get('setter') prop.getter = node.attrib.get('getter') + prop.default_value = node.attrib.get('default-value') prop.parent = parent self._parse_generic_attribs(node, prop) return prop diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index 9ff10d31..a3b3bc3e 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -560,6 +560,8 @@ class GIRWriter(XMLWriter): attrs.append(('setter', prop.setter)) if prop.getter: attrs.append(('getter', prop.getter)) + if prop.default_value: + attrs.append(('default-value', prop.default_value)) with self.tagcontext('property', attrs): self._write_generic(prop) self._write_type(prop.type) |