xcbgen: fields get a parent reference
authorChristian Linhart <chris@DemoRecorder.com>
Sun, 2 Nov 2014 12:47:07 +0000 (13:47 +0100)
committerChristian Linhart <chris@demorecorder.com>
Mon, 3 Nov 2014 10:23:22 +0000 (11:23 +0100)
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.

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>
Message-ID: <545627CB.1000606@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 1/8
Patch-Version: V1

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):
         '''