From e21655632e3fd40b7f6a5cc3c7f3c379d54557c4 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 30 Aug 2014 13:41:12 +0200 Subject: xserver libxtrans libxcb xcb-proto libX11 mesa git update 30 Aug 2014 xserver commit 3a51418b2db353519a1779cf3cebbcc9afba2520 libxcb commit b0e6c2de09c7474868dd7185674fa113a5c2e0aa libxcb/xcb-proto commit dc0c544fe044ddeb4917bba0c2fed66c70e6db43 libX11 commit 6101b967b641355dd863fd1ce52c6a7d58bcbe68 libxtrans commit 17491de45c352c833442cccf17a9bd65909889db mesa commit 932b0ef1ceecf873213447a8778e5cbe1b3b6be7 --- libxcb/xcb-proto/xcbgen/xtypes.py | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'libxcb/xcb-proto/xcbgen/xtypes.py') diff --git a/libxcb/xcb-proto/xcbgen/xtypes.py b/libxcb/xcb-proto/xcbgen/xtypes.py index 3cd90320e..45d7568f5 100644 --- a/libxcb/xcb-proto/xcbgen/xtypes.py +++ b/libxcb/xcb-proto/xcbgen/xtypes.py @@ -33,7 +33,9 @@ class Type(object): self.is_union = False self.is_pad = False self.is_switch = False + self.is_case_or_bitcase = False self.is_bitcase = False + self.is_case = False def resolve(self, module): ''' @@ -405,16 +407,20 @@ class SwitchType(ComplexType): # Resolve all of our field datatypes. for index, child in enumerate(list(self.elt)): - if child.tag == 'bitcase': + if child.tag == 'bitcase' or child.tag == 'case': field_name = child.get('name') if field_name is None: - field_type = self.name + ('bitcase%d' % index,) + field_type = self.name + ('%s%d' % ( child.tag, index ),) else: field_type = self.name + (field_name,) # use self.parent to indicate anchestor, # as switch does not contain named fields itself - type = BitcaseType(index, field_type, child, *parents) + if child.tag == 'bitcase': + type = BitcaseType(index, field_type, child, *parents) + else: + type = CaseType(index, field_type, child, *parents) + # construct the switch type name from the parent type and the field name if field_name is None: type.has_name = False @@ -497,9 +503,9 @@ class Union(ComplexType): out = __main__.output['union'] -class BitcaseType(ComplexType): +class CaseOrBitcaseType(ComplexType): ''' - Derived class representing a struct data type. + Derived class representing a case or bitcase. ''' def __init__(self, index, name, elt, *parent): elts = list(elt) @@ -515,7 +521,7 @@ class BitcaseType(ComplexType): self.index = 1 self.lenfield_parent = list(parent) + [self] self.parents = list(parent) - self.is_bitcase = True + self.is_case_or_bitcase = True def make_member_of(self, module, switch_type, field_type, field_name, visible, wire, auto, enum=None): ''' @@ -546,6 +552,23 @@ class BitcaseType(ComplexType): ComplexType.resolve(self, module) +class BitcaseType(CaseOrBitcaseType): + ''' + Derived class representing a bitcase. + ''' + def __init__(self, index, name, elt, *parent): + CaseOrBitcaseType.__init__(self, index, name, elt, *parent) + self.is_bitcase = True + +class CaseType(CaseOrBitcaseType): + ''' + Derived class representing a case. + ''' + def __init__(self, index, name, elt, *parent): + CaseOrBitcaseType.__init__(self, index, name, elt, *parent) + self.is_case = True + + class Reply(ComplexType): ''' Derived class representing a reply. Only found as a field of Request. -- cgit v1.2.3