xcbgen: fields get a parent reference
authorChristian Linhart <chris@demorecorder.com>
Wed, 3 Sep 2014 11:17:54 +0000 (13:17 +0200)
committerChristian Linhart <chris@demorecorder.com>
Tue, 9 Sep 2014 21:54:45 +0000 (23:54 +0200)
Objects of type Field get a reference to their parent.
This is needed in the generator to differentiate
field handling dependend on properties of their parent.

Message-ID: <1409743080-302-1-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ...
Patch-Set: ListInputDevices
Patch-Number: proto 1/7
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
xcbgen/expr.py
xcbgen/xtypes.py

index e4fb06e..51e738f 100644 (file)
@@ -22,6 +22,7 @@ class Field(object):
         self.wire = wire
         self.auto = auto
         self.isfd = isfd
+        self.parent = None
 
 
 class Expression(object):
index 45d7568..8ecbaa2 100644 (file)
@@ -76,6 +76,7 @@ class Type(object):
                 return
 
         complex_type.fields.append(new_field)
+        new_field.parent = complex_type
 
     def make_fd_of(self, module, complex_type, fd_name):
         '''