summaryrefslogtreecommitdiff
path: root/tools/glib-interfaces-gen.py
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-11-25 11:25:33 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-11-25 11:25:33 +0000
commit9aea9925ffca341a6dcd83808fa89b721314b38e (patch)
tree7c4d0eb686cdcb46a4e03098562e22393af7c8c0 /tools/glib-interfaces-gen.py
parent314b455de68fa347a2018b2787f25d5994328da3 (diff)
downloadtelepathy-glib-9aea9925ffca341a6dcd83808fa89b721314b38e.tar.gz
Generate and document constants for D-Bus property names
Diffstat (limited to 'tools/glib-interfaces-gen.py')
-rw-r--r--tools/glib-interfaces-gen.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/glib-interfaces-gen.py b/tools/glib-interfaces-gen.py
index 9b23764a9..e573249b1 100644
--- a/tools/glib-interfaces-gen.py
+++ b/tools/glib-interfaces-gen.py
@@ -92,6 +92,22 @@ GQuark
parent_name).lower().replace('/', ''),
'name' : iface.getAttribute('name')})
+ for prop in iface.getElementsByTagNameNS(None, 'property'):
+ self.decls.write("""
+/**
+ * %(IFACE_PREFIX)s_%(PROP_UC)s:
+ *
+ * The fully-qualified property name "%(name)s.%(prop)s"
+ */
+#define %(IFACE_PREFIX)s_%(PROP_UC)s \\
+"%(name)s.%(prop)s"
+""" % {'IFACE_PREFIX' : (self.prefix + 'PROP_' + \
+ parent_name).upper().replace('/', ''),
+ 'PROP_UC': prop.getAttributeNS(NS_TP, "name-for-bindings").upper(),
+ 'name' : iface.getAttribute('name'),
+ 'prop' : prop.getAttribute('name'),
+ })
+
if __name__ == '__main__':
argv = argv[1:]
Generator(argv[0], argv[1], argv[2], xml.dom.minidom.parse(argv[3]))()