Logo Search packages:      
Sourcecode: xcb-proto version File versions

def xcbgen::xtypes::ListType::make_member_of (   self,

Default method for making a data type a member of a structure.
Extend this if the data type needs to add an additional length field or something.

module is the global module object.
complex_type is the structure object.
see Field for the meaning of the other parameters.

Reimplemented from xcbgen::xtypes::Type.

Definition at line 168 of file xtypes.py.

00168                                                                                                :
        if not self.fixed_size():
            # We need a length field.
            # Ask our Expression object for it's name, type, and whether it's on the wire.
            lenfid = self.expr.lenfield_type
            lenfield_name = self.expr.lenfield_name
            lenwire = self.expr.lenwire
            needlen = True

            # See if the length field is already in the structure.
            for field in self.parent.fields:
                if field.field_name == lenfield_name:
                    needlen = False

            # It isn't, so we need to add it to the structure ourself.
            if needlen:
                type = module.get_type(lenfid)
                lenfield_type = module.get_type_name(lenfid)
                type.make_member_of(module, complex_type, lenfield_type, lenfield_name, True, lenwire, False)

        # Add ourself to the structure by calling our original method.
        Type.make_member_of(self, module, complex_type, field_type, field_name, visible, wire, auto)

    def resolve(self, module):

Generated by  Doxygen 1.6.0   Back to index