summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@litl.com>2010-05-10 19:00:14 -0300
committerJohan Dahlin <johan@gnome.org>2010-05-27 10:13:33 -0300
commite0d017ac04190d8f5dac65005b69132bbeeb35dd (patch)
tree70a9b41c8fb1961794e1de303f0767788c7696f0 /giscanner
parent15cfa49be6976c0d8a5574164feca6b0212a7f4a (diff)
downloadgobject-introspection-e0d017ac04190d8f5dac65005b69132bbeeb35dd.tar.gz
Add type annotation for properties
Add type annotation syntax for GObject properties. This makes it possible to override the type of a property. For instance, this will allow function pointers with a G_TYPE_POINTER type set to be used from a language binding which reads the typelib information in addition g_object_class_find_property. https://bugzilla.gnome.org/show_bug.cgi?id=618318
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/annotationparser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 180de6be..ef60179b 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -52,6 +52,7 @@ TAG_RETURNS = 'returns'
TAG_RETURNS_ALT = 'return value'
TAG_ATTRIBUTES = 'attributes'
TAG_RENAME_TO = 'rename to'
+TAG_TYPE = 'type'
# Options - annotations for parameters and return values
OPT_ALLOW_NONE = 'allow-none'
@@ -409,6 +410,9 @@ class AnnotationApplier(object):
self._parse_node_common(prop, block)
if block:
prop.doc = block.comment
+ type_tag = self._get_tag(block, TAG_TYPE)
+ if type_tag:
+ prop.type = self._resolve(type_tag.value, prop.type)
def _parse_callback(self, callback):
block = self._blocks.get(callback.ctype)