xv: Add align. pad in struct AdaptorInfo
[free-sw/xcb/proto] / xcbgen / state.py
index 51efc94..a6ad3a1 100644 (file)
@@ -4,9 +4,9 @@ This module contains the namespace class and the singleton module class.
 from os.path import dirname, basename
 from xml.etree.cElementTree import parse
 
-import matcher
-from error import *
-from xtypes import *
+from xcbgen import matcher
+from xcbgen.error import *
+from xcbgen.xtypes import *
 
 import __main__
 
@@ -65,6 +65,8 @@ class Module(object):
         self.output = output
 
         self.imports = []
+        self.direct_imports = []
+        self.import_level = 0
         self.types = {}
         self.events = {}
         self.errors = {}
@@ -74,9 +76,11 @@ class Module(object):
         self.add_type('CARD8', '', ('uint8_t',), tcard8)
         self.add_type('CARD16', '', ('uint16_t',), tcard16)
         self.add_type('CARD32', '', ('uint32_t',), tcard32)
+        self.add_type('CARD64', '', ('uint64_t',), tcard64)
         self.add_type('INT8', '', ('int8_t',), tint8)
         self.add_type('INT16', '', ('int16_t',), tint16)
         self.add_type('INT32', '', ('int32_t',), tint32)
+        self.add_type('INT64', '', ('int64_t',), tint64)
         self.add_type('BYTE', '', ('uint8_t',), tcard8)
         self.add_type('BOOL', '', ('uint8_t',), tcard8)
         self.add_type('char', '', ('char',), tchar)
@@ -91,6 +95,7 @@ class Module(object):
     # Recursively resolve all types
     def resolve(self):
         for (name, item) in self.all:
+            self.pads = 0
             item.resolve(self)
 
     # Call all the output methods
@@ -104,6 +109,8 @@ class Module(object):
 
     # Keeps track of what's been imported so far.
     def add_import(self, name, namespace):
+        if self.import_level == 0:
+            self.direct_imports.append((name, namespace.header))
         self.imports.append((name, namespace.header))
 
     def has_import(self, name):