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/doc/xml-xcb.txt | 43 ++++-- libxcb/xcb-proto/src/xcb.xsd | 5 +- libxcb/xcb-proto/src/xinput.xml | 284 ++++++++++++++++++++++++++++---------- libxcb/xcb-proto/xcbgen/expr.py | 2 +- libxcb/xcb-proto/xcbgen/xtypes.py | 35 ++++- 5 files changed, 279 insertions(+), 90 deletions(-) (limited to 'libxcb/xcb-proto') diff --git a/libxcb/xcb-proto/doc/xml-xcb.txt b/libxcb/xcb-proto/doc/xml-xcb.txt index 97ce5bf8e..235958de3 100644 --- a/libxcb/xcb-proto/doc/xml-xcb.txt +++ b/libxcb/xcb-proto/doc/xml-xcb.txt @@ -184,11 +184,12 @@ separated by a single colon. For example, to refer to the PIXMAP type defined in glx rather than the one defined in xproto, use type="glx:PIXMAP" rather than type="PIXMAP". -Note: Most of the below may optionally contain an enum, altenum, or mask +Note: Most of the below may optionally contain an enum, altenum, mask or altmask attribute, which follows the above rules for "type". "enum" is an exhaustive enum; the value is restricted to one of the constants named in the enum. "altenum" may be one of the values contained in the enum, but it need not be. -"mask" refers to an enum to be used as a bitmask. +"mask" refers to an exhaustive enum to be used as a bitmask. +"altmask" may be a mask from the referred enum, but it need not be. @@ -243,18 +244,40 @@ enum; the value is restricted to one of the constants named in the enum. instead for new protocol definitions. switch expression - bitcase expression(s), fields + bitcase expression(s), fields + case expression(s), fields + This element represents conditional inclusion of fields. It can be viewed - as sequence of multiple ifs: if ( switch expression & bitcase expression ) - is non-zero, bitcase fields are included in structure. It can be used only - as the last field of a structure. + as sequence of multiple ifs: - When a bitcase includes multiple clauses, the contents of the - bitcase are only present once regardless of the number of bitcase expressions - that match. + : + if ( switch expression & bitcase expression ) is non-zero, + bitcase fields are included in structure. + + : + if ( switch expression == case expression ) is true, + then case fields are included in structure. + + It can be used only as the last field of a structure. + + When a bitcase or case includes multiple clauses, the contents + of the bitcase or case are only present once regardless of the number of + bitcase or case expressions that match. + + inside can only refer to an enum's members. + inside can only refer to an enum's members. + + A switch may contain multiple or elements. + Usually it will only contain elements + or only contain elements. + That is, mixing of and usually doesn't make any sense. + + The same value may appear in multiple or elements. + + New protocol definitions should prefer to use this instead of + and instead of . - New protocol definitions should prefer to use this instead of . Expressions ----------- diff --git a/libxcb/xcb-proto/src/xcb.xsd b/libxcb/xcb-proto/src/xcb.xsd index 59bb9a883..85f5bc2af 100644 --- a/libxcb/xcb-proto/src/xcb.xsd +++ b/libxcb/xcb-proto/src/xcb.xsd @@ -54,6 +54,7 @@ authorization from the authors. + @@ -77,7 +78,9 @@ authorization from the authors. - + + + diff --git a/libxcb/xcb-proto/src/xinput.xml b/libxcb/xcb-proto/src/xinput.xml index cdb414db4..dc87e7829 100644 --- a/libxcb/xcb-proto/src/xinput.xml +++ b/libxcb/xcb-proto/src/xinput.xml @@ -32,6 +32,73 @@ authorization from the authors. http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt --> + + + xfixes @@ -63,7 +130,7 @@ authorization from the authors. name_len - + @@ -89,6 +156,17 @@ authorization from the authors. 4 5 6 + @@ -150,7 +228,7 @@ authorization from the authors. - + @@ -173,12 +251,13 @@ authorization from the authors. - + num_classes + @@ -196,8 +275,9 @@ authorization from the authors. - - + + + @@ -218,7 +298,7 @@ authorization from the authors. - + @@ -253,7 +333,7 @@ authorization from the authors. - + @@ -266,7 +346,7 @@ authorization from the authors. - @@ -274,8 +354,9 @@ authorization from the authors. + - + @@ -290,8 +371,11 @@ authorization from the authors. - - + + + @@ -304,8 +388,11 @@ authorization from the authors. - - + + + @@ -325,7 +412,7 @@ authorization from the authors. num_classes - + @@ -336,15 +423,20 @@ authorization from the authors. + + + 255 + + - + @@ -361,7 +453,7 @@ authorization from the authors. - + @@ -371,13 +463,13 @@ authorization from the authors. - + - + num_classes @@ -389,9 +481,10 @@ authorization from the authors. - + + @@ -409,6 +502,7 @@ authorization from the authors. + @@ -417,7 +511,7 @@ authorization from the authors. - + @@ -432,6 +526,7 @@ authorization from the authors. + @@ -526,7 +621,7 @@ authorization from the authors. - + @@ -609,8 +704,24 @@ authorization from the authors. + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 0 + 0 + 0 + 1 + 2 + + - + @@ -623,8 +734,9 @@ authorization from the authors. + - + @@ -655,7 +767,7 @@ authorization from the authors. - + @@ -680,7 +792,7 @@ authorization from the authors. - + @@ -692,12 +804,13 @@ authorization from the authors. - + map_size + @@ -711,7 +824,7 @@ authorization from the authors. map_size - + @@ -739,11 +852,16 @@ authorization from the authors. + + 0 + 1 + + - + num_valuators @@ -766,7 +884,7 @@ authorization from the authors. - + @@ -815,7 +933,7 @@ authorization from the authors. num_valuators - + @@ -901,7 +1019,7 @@ authorization from the authors. - + @@ -976,7 +1094,7 @@ authorization from the authors. - + @@ -990,7 +1108,7 @@ authorization from the authors. - + @@ -1017,28 +1135,26 @@ authorization from the authors. format - - + 8Bits num_items - - + + + 16Bits num_items - - + + + 32Bits num_items - + @@ -1061,7 +1177,7 @@ authorization from the authors. - + @@ -1079,12 +1195,14 @@ authorization from the authors. num_items + 16Bits num_items + 32Bits @@ -1131,7 +1249,7 @@ authorization from the authors. - + @@ -1184,11 +1302,12 @@ authorization from the authors. - - + + name_len + @@ -1392,7 +1511,7 @@ authorization from the authors. - + @@ -1436,26 +1555,16 @@ authorization from the authors. - + - - - - - name_len - 3 - - 4 - - 4 - + name_len + num_classes @@ -1579,6 +1688,7 @@ authorization from the authors. + @@ -1708,12 +1818,14 @@ authorization from the authors. num_items + 16Bits num_items + 32Bits @@ -1772,6 +1884,12 @@ authorization from the authors. + + + 7 + + @@ -1782,9 +1900,9 @@ authorization from the authors. - + - + @@ -1805,13 +1923,25 @@ authorization from the authors. + + 7 + + + 6 + + + 2 + 1 + 0 + + - + - + 4 @@ -1825,7 +1955,7 @@ authorization from the authors. - + @@ -1833,22 +1963,27 @@ authorization from the authors. + + 0 + 1 + + - + - + 28 - + 28 @@ -2016,8 +2151,8 @@ authorization from the authors. - - + + @@ -2208,6 +2343,11 @@ authorization from the authors. + + 0 + 1 + + @@ -2218,7 +2358,7 @@ authorization from the authors. - + diff --git a/libxcb/xcb-proto/xcbgen/expr.py b/libxcb/xcb-proto/xcbgen/expr.py index f9d5179f0..e4fb06e93 100644 --- a/libxcb/xcb-proto/xcbgen/expr.py +++ b/libxcb/xcb-proto/xcbgen/expr.py @@ -120,7 +120,7 @@ class Expression(object): for p in reversed(parents): fields = dict([(f.field_name, f) for f in p.fields]) if self.lenfield_name in fields.keys(): - if p.is_bitcase: + if p.is_case_or_bitcase: # switch is the anchestor self.lenfield_parent = p.parents[-1] else: 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