diff options
author | marha <marha@users.sourceforge.net> | 2014-08-30 13:41:12 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-30 13:43:25 +0200 |
commit | e21655632e3fd40b7f6a5cc3c7f3c379d54557c4 (patch) | |
tree | 46054f4b20f70afd1c7743e54aa48471e2ded483 /libxcb | |
parent | 6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (diff) | |
download | vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.gz vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.bz2 vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.zip |
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
Diffstat (limited to 'libxcb')
-rw-r--r-- | libxcb/src/c_client.py | 55 | ||||
-rw-r--r-- | libxcb/src/xcb_conn.c | 26 | ||||
-rw-r--r-- | libxcb/xcb-proto/doc/xml-xcb.txt | 43 | ||||
-rw-r--r-- | libxcb/xcb-proto/src/xcb.xsd | 5 | ||||
-rw-r--r-- | libxcb/xcb-proto/src/xinput.xml | 284 | ||||
-rw-r--r-- | libxcb/xcb-proto/xcbgen/expr.py | 2 | ||||
-rw-r--r-- | libxcb/xcb-proto/xcbgen/xtypes.py | 35 |
7 files changed, 335 insertions, 115 deletions
diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py index 54e56c42d..87f268b61 100644 --- a/libxcb/src/c_client.py +++ b/libxcb/src/c_client.py @@ -358,7 +358,7 @@ def _c_type_setup(self, name, postfix): field.c_pointer = '*' field.c_field_const_type = 'const ' + field.c_field_type self.c_need_aux = True - elif not field.type.fixed_size() and not field.type.is_bitcase: + elif not field.type.fixed_size() and not field.type.is_case_or_bitcase: self.c_need_sizeof = True field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t @@ -407,7 +407,7 @@ def _c_type_setup(self, name, postfix): # no list with switch as element, so no call to # _c_iterator(field.type, field_name) necessary - if not self.is_bitcase: + if not self.is_case_or_bitcase: if self.c_need_serialize: if self.c_serialize_name not in finished_serializers: finished_serializers.append(self.c_serialize_name) @@ -437,7 +437,7 @@ def _c_helper_absolute_name(prefix, field=None): prefix_str += name if '' == sep: sep = '->' - if ((obj.is_bitcase and obj.has_name) or # named bitcase + if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase (obj.is_switch and len(obj.parents)>1)): sep = '.' prefix_str += sep @@ -470,7 +470,7 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): all_fields[f.field_name] = (fname, f) if f.type.is_container and flat==False: - if f.type.is_bitcase and not f.type.has_name: + if f.type.is_case_or_bitcase and not f.type.has_name: new_prefix = prefix elif f.type.is_switch and len(f.type.parents)>1: # nested switch gets another separator @@ -493,10 +493,10 @@ def _c_helper_resolve_field_names (prefix): name, sep, obj = p if ''==sep: # sep can be preset in prefix, if not, make a sensible guess - sep = '.' if (obj.is_switch or obj.is_bitcase) else '->' + sep = '.' if (obj.is_switch or obj.is_case_or_bitcase) else '->' # exception: 'toplevel' object (switch as well!) always have sep '->' sep = '->' if idx<1 else sep - if not obj.is_bitcase or (obj.is_bitcase and obj.has_name): + if not obj.is_case_or_bitcase or (obj.is_case_or_bitcase and obj.has_name): tmp_prefix.append((name, sep, obj)) all_fields.update(_c_helper_field_mapping(obj, tmp_prefix, flat=True)) @@ -689,18 +689,29 @@ def _c_serialize_helper_switch(context, self, complex_name, for b in self.bitcases: len_expr = len(b.type.expr) + + compare_operator = '&' + if b.type.is_case: + compare_operator = '==' + else: + compare_operator = '&' + for n, expr in enumerate(b.type.expr): bitcase_expr = _c_accessor_get_expr(expr, None) # only one <enumref> in the <bitcase> if len_expr == 1: - code_lines.append(' if(%s & %s) {' % (switch_expr, bitcase_expr)) + code_lines.append( + ' if(%s %s %s) {' % (switch_expr, compare_operator, bitcase_expr)) # multiple <enumref> in the <bitcase> elif n == 0: # first - code_lines.append(' if((%s & %s) ||' % (switch_expr, bitcase_expr)) + code_lines.append( + ' if((%s %s %s) ||' % (switch_expr, compare_operator, bitcase_expr)) elif len_expr == (n + 1): # last - code_lines.append(' (%s & %s)) {' % (switch_expr, bitcase_expr)) + code_lines.append( + ' (%s %s %s)) {' % (switch_expr, compare_operator, bitcase_expr)) else: # between first and last - code_lines.append(' (%s & %s) ||' % (switch_expr, bitcase_expr)) + code_lines.append( + ' (%s %s %s) ||' % (switch_expr, compare_operator, bitcase_expr)) b_prefix = prefix if b.type.has_name: @@ -710,7 +721,7 @@ def _c_serialize_helper_switch(context, self, complex_name, code_lines, temp_vars, "%s " % space, b_prefix, - is_bitcase = True) + is_case_or_bitcase = True) code_lines.append(' }') # if 'serialize' == context: @@ -834,7 +845,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, code_lines, temp_vars, space, prefix): # keep the C code a bit more readable by giving the field name - if not self.is_bitcase: + if not self.is_case_or_bitcase: code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) else: scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] @@ -951,7 +962,7 @@ def _c_serialize_helper_fields_variable_size(context, self, field, def _c_serialize_helper_fields(context, self, code_lines, temp_vars, - space, prefix, is_bitcase): + space, prefix, is_case_or_bitcase): count = 0 need_padding = False prev_field_was_variable = False @@ -963,7 +974,7 @@ def _c_serialize_helper_fields(context, self, # switch/bitcase: fixed size fields must be considered explicitly if field.type.fixed_size(): - if self.is_bitcase or self.c_var_followed_by_fixed_fields: + if self.is_case_or_bitcase or self.c_var_followed_by_fixed_fields: if prev_field_was_variable and need_padding: # insert padding # count += _c_serialize_helper_insert_padding(context, code_lines, space, @@ -989,7 +1000,7 @@ def _c_serialize_helper_fields(context, self, continue else: # switch/bitcase: always calculate padding before and after variable sized fields - if need_padding or is_bitcase: + if need_padding or is_case_or_bitcase: count += _c_serialize_helper_insert_padding(context, code_lines, space, self.c_var_followed_by_fixed_fields) @@ -1003,7 +1014,7 @@ def _c_serialize_helper_fields(context, self, code_lines.append('%s%s' % (space, value)) if field.type.fixed_size(): - if is_bitcase or self.c_var_followed_by_fixed_fields: + if is_case_or_bitcase or self.c_var_followed_by_fixed_fields: # keep track of (un)serialized object's size code_lines.append('%s xcb_block_len += %s;' % (space, length)) if context in ('unserialize', 'unpack', 'sizeof'): @@ -1461,7 +1472,7 @@ def _c_accessors_field(self, field): # special case: switch switch_obj = self if self.is_switch else None - if self.is_bitcase: + if self.is_case_or_bitcase: switch_obj = self.parents[-1] if switch_obj is not None: c_type = switch_obj.c_type @@ -1529,7 +1540,7 @@ def _c_accessors_list(self, field): # the reason is that switch is either a child of a request/reply or nested in another switch, # so whenever we need to access a length field, we might need to refer to some anchestor type switch_obj = self if self.is_switch else None - if self.is_bitcase: + if self.is_case_or_bitcase: switch_obj = self.parents[-1] if switch_obj is not None: c_type = switch_obj.c_type @@ -1561,7 +1572,7 @@ def _c_accessors_list(self, field): for p in parents[2:] + [self]: # the separator between parent and child is always '.' here, # because of nested switch statements - if not p.is_bitcase or (p.is_bitcase and p.has_name): + if not p.is_case_or_bitcase or (p.is_case_or_bitcase and p.has_name): prefix.append((p.name[-1], '.', p)) fields.update(_c_helper_field_mapping(p, prefix, flat=True)) @@ -2364,7 +2375,7 @@ def _man_request(self, name, cookie_type, void, aux): # special case: switch switch_obj = self if self.is_switch else None - if self.is_bitcase: + if self.is_case_or_bitcase: switch_obj = self.parents[-1] if switch_obj is not None: c_type = switch_obj.c_type @@ -2392,7 +2403,7 @@ def _man_request(self, name, cookie_type, void, aux): # the reason is that switch is either a child of a request/reply or nested in another switch, # so whenever we need to access a length field, we might need to refer to some anchestor type switch_obj = self if self.is_switch else None - if self.is_bitcase: + if self.is_case_or_bitcase: switch_obj = self.parents[-1] if switch_obj is not None: c_type = switch_obj.c_type @@ -2424,7 +2435,7 @@ def _man_request(self, name, cookie_type, void, aux): for p in parents[2:] + [self]: # the separator between parent and child is always '.' here, # because of nested switch statements - if not p.is_bitcase or (p.is_bitcase and p.has_name): + if not p.is_case_or_bitcase or (p.is_case_or_bitcase and p.has_name): prefix.append((p.name[-1], '.', p)) fields.update(_c_helper_field_mapping(p, prefix, flat=True)) diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index fa5098586..7d0963716 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -64,6 +64,26 @@ typedef struct { uint16_t length; } xcb_setup_generic_t; +static const xcb_setup_t xcb_error_setup = { + 0, /* status: failed (but we wouldn't have a xcb_setup_t in this case) */ + 0, /* pad0 */ + 0, 0, /* protocol version, should be 11.0, but isn't */ + 0, /* length, invalid value */ + 0, /* release_number */ + 0, 0, /* resource_id_{base,mask} */ + 0, /* motion_buffer_size */ + 0, /* vendor_len */ + 0, /* maximum_request_length */ + 0, /* roots_len */ + 0, /* pixmap_formats_len */ + 0, /* image_byte_order */ + 0, /* bitmap_format_bit_order */ + 0, /* bitmap_format_scanline_unit */ + 0, /* bitmap_format_scanline_pad */ + 0, 0, /* {min,max}_keycode */ + { 0, 0, 0, 0 } /* pad1 */ +}; + /* Keep this list in sync with is_static_error_conn()! */ static const int xcb_con_error = XCB_CONN_ERROR; static const int xcb_con_closed_mem_er = XCB_CONN_CLOSED_MEM_INSUFFICIENT; @@ -288,15 +308,15 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) const xcb_setup_t *xcb_get_setup(xcb_connection_t *c) { - if(c->has_error) - return 0; + if(is_static_error_conn(c)) + return &xcb_error_setup; /* doesn't need locking because it's never written to. */ return c->setup; } int xcb_get_file_descriptor(xcb_connection_t *c) { - if(c->has_error) + if(is_static_error_conn(c)) return -1; /* doesn't need locking because it's never written to. */ return c->fd; 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. <pad bytes="integer" /> @@ -243,18 +244,40 @@ enum; the value is restricted to one of the constants named in the enum. <switch> instead for new protocol definitions. <switch name="identifier"> switch expression - <bitcase> bitcase expression(s), fields </bitcase> </switch> + <bitcase> bitcase expression(s), fields </bitcase> + <case> case expression(s), fields </case> +</switch> 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 <enumref> clauses, the contents of the - bitcase are only present once regardless of the number of bitcase expressions - that match. + <bitcase>: + if ( switch expression & bitcase expression ) is non-zero, + bitcase fields are included in structure. + + <case>: + 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 <enumref> clauses, the contents + of the bitcase or case are only present once regardless of the number of + bitcase or case expressions that match. + + <enumref> inside <bitcase> can only refer to an enum's <bit> members. + <enumref> inside <case> can only refer to an enum's <value> members. + + A switch may contain multiple <bitcase> or <case> elements. + Usually it will only contain <bitcase> elements + or only contain <case> elements. + That is, mixing of <case> and <bitcase> usually doesn't make any sense. + + The same value may appear in multiple <case> or <bitcase> elements. + + New protocol definitions should prefer to use this instead of <valueparam> + and instead of <union>. - New protocol definitions should prefer to use this instead of <valueparam>. 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. <xsd:attribute name="enum" type="xsd:string" use="optional" /> <xsd:attribute name="altenum" type="xsd:string" use="optional" /> <xsd:attribute name="mask" type="xsd:string" use="optional" /> + <xsd:attribute name="altmask" type="xsd:string" use="optional" /> </xsd:complexType> <!-- case expression --> @@ -77,7 +78,9 @@ authorization from the authors. <xsd:group ref="expression" minOccurs="1" maxOccurs="1" /> <xsd:choice> <!-- bitcase expression - bit test --> - <xsd:element name="bitcase" type="caseexpr" minOccurs="1" maxOccurs="unbounded" /> + <xsd:element name="bitcase" type="caseexpr" minOccurs="0" maxOccurs="unbounded" /> + <!-- case expression - value test --> + <xsd:element name="case" type="caseexpr" minOccurs="0" maxOccurs="unbounded" /> </xsd:choice> <!-- default: --> <xsd:group ref="fields" minOccurs="0" maxOccurs="1" /> 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 --> +<!-- TODO: Things which need to be done for full XInput support + but cannot be done now ( August 18, 2014 ) with the current feature-set + of the xml and the generator: + +***** + +replace "uninterpreted_data" or similar constructs +with a semantic that shows how to interpret this data. +This requires enhancements to the xml-schema and generator such as union with selector. + +This will, e.g., be necessary for automatically generated byte-order conversion code, +which will, e.g., be necessary for server-side xcb. + +This affects the following: +* GetFeedbackControl reply field "feedbacks" ( structs FeedbackState, ... ) +* ChangeFeedbackControl request field "feedback" ( structs FeedbackCtl, ... ) +* QueryDeviceState reply field "classes" ( structs InputState, ... ) +* GetDeviceControl reply field "control" ( structs DeviceState, ... ) +* ChangeDeviceControl request field "control" ( structs ChangeDeviceControl, ... ) +* XIChangeHierarchy request field "changes" ( structs HierarchyChange, ... ) +* struct XIDeviceInfo field "classes" ( structs DeviceClass, ... ) +* SendExtensionEvent member "events" + +***** + +xml and generator have to support <popcount> of all members of a list + +This is needed for the following XI2-events ( and eventcopies thereof ) + KeyPress + ButtonPress + RawKeyPress + RawKeyPress + RawButtonPress + TouchBegin + RawTouchBegin + + +***** + +<sumof> should support fields of listmembers. + +This is needed for request "ListInputDevices" + +***** + +xml and generator should support +switch-case similar to switch-bitcase. + +(and maybe: variable sized unions with a mechanism to define +which union-field is selected.) + +One of these features is needed for the InputInfo type +which is used by request "ListInputDevices" for the list "input_infos". + +***** + +Parametrized structs + +This is needed for being able to use the value of the field +"num_axes" of the GetDeviceMotionEvents-reply +in struct DeviceTimeCoord. + +***** + +--> + + <xcb header="xinput" extension-xname="XInputExtension" extension-name="Input" major-version="2" minor-version="3"> <import>xfixes</import> @@ -63,7 +130,7 @@ authorization from the authors. <fieldref>name_len</fieldref> </list> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD16" name="server_major" /> <field type="CARD16" name="server_minor" /> <field type="BOOL" name="present" /> @@ -89,6 +156,17 @@ authorization from the authors. <item name="Proximity"> <value>4</value> </item> <item name="Focus"> <value>5</value> </item> <item name="Other"> <value>6</value> </item> + <!-- + value Attach=7 is still contained in XI.h as "#define AttachClass" + but it was never transmitted over the protocol. + (It was used to tag a fake class created by libXi). + + Even the creation of that fake class has been dropped + from libXi in 2009 by the following change: + http://cgit.freedesktop.org/xorg/lib/libXi/commit/?id=62858c426e6de1b99df660251737233afd335302 + + <item name="Attach"> <value>7</value> </item> + --> </enum> <enum name="ValuatorMode"> @@ -150,7 +228,7 @@ authorization from the authors. <request name="ListInputDevices" opcode="2"> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="devices_len" /> <pad bytes="23" /> <list type="DeviceInfo" name="devices"> @@ -173,12 +251,13 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="num_classes" /> <pad bytes="23" /> <list type="InputClassInfo" name="class_info"> <fieldref>num_classes</fieldref> </list> + <pad align="4" /> </reply> </request> @@ -196,8 +275,9 @@ authorization from the authors. <field type="CARD8" name="mode" enum="ValuatorMode" /> <pad bytes="2" /> <reply> - <pad bytes="1" /> - <field type="CARD8" name="status" altenum="GrabStatus" /> + <field type="CARD8" name="xi_reply_type" /> + <!-- values for status: 0: Success, 1: AlreadyGrabbed --> + <field type="CARD8" name="status" enum="GrabStatus" /> <pad bytes="23" /> </reply> </request> @@ -218,7 +298,7 @@ authorization from the authors. <request name="GetSelectedExtensionEvents" opcode="7"> <field type="WINDOW" name="window" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD16" name="num_this_classes" /> <field type="CARD16" name="num_all_classes" /> <pad bytes="20" /> @@ -253,7 +333,7 @@ authorization from the authors. <request name="GetDeviceDontPropagateList" opcode="9"> <field type="WINDOW" name="window" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD16" name="num_classes" /> <pad bytes="22" /> <list type="EventClass" name="classes"> @@ -266,7 +346,7 @@ authorization from the authors. <struct name="DeviceTimeCoord"> <field type="TIMESTAMP" name="time" /> - <!-- Uninterpreted: list (axisvalues) of CARD32, + <!-- Uninterpreted: list (axisvalues) of INT32, length is num_axes from GetDeviceMotionEvents --> </struct> @@ -274,8 +354,9 @@ authorization from the authors. <field type="TIMESTAMP" name="start" /> <field type="TIMESTAMP" name="stop" altenum="Time" /> <field type="CARD8" name="device_id" /> + <pad bytes="3"/> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD32" name="num_events" /> <field type="CARD8" name="num_axes" /> <field type="CARD8" name="device_mode" enum="ValuatorMode" /> @@ -290,8 +371,11 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> - <field type="CARD8" name="status" altenum="GrabStatus" /> + <field type="CARD8" name="xi_reply_type" /> + <!-- only the following GrabStatus-values are valid here: + "Success", "AlreadyGrabbed", and "Frozen" + --> + <field type="CARD8" name="status" enum="GrabStatus" /> <pad bytes="23" /> </reply> </request> @@ -304,8 +388,11 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="1" /> <reply> - <pad bytes="1" /> - <field type="CARD8" name="status" altenum="GrabStatus" /> + <field type="CARD8" name="xi_reply_type" /> + <!-- only the following GrabStatus-values are valid here: + "Success", "AlreadyGrabbed", and "Frozen" + --> + <field type="CARD8" name="status" enum="GrabStatus" /> <pad bytes="23" /> </reply> </request> @@ -325,7 +412,7 @@ authorization from the authors. <fieldref>num_classes</fieldref> </list> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" enum="GrabStatus" /> <pad bytes="23" /> </reply> @@ -336,15 +423,20 @@ authorization from the authors. <request name="UngrabDevice" opcode="14"> <field type="TIMESTAMP" name="time" altenum="Time" /> <field type="CARD8" name="device_id" /> + <pad bytes="3" /> </request> <!-- GrabDeviceKey --> + <enum name="ModifierDevice"> + <item name="UseXKeyboard"><value>255</value></item> <!-- 0xff --> + </enum> + <request name="GrabDeviceKey" opcode="15"> <field type="WINDOW" name="grab_window" /> <field type="CARD16" name="num_classes" /> <field type="CARD16" name="modifiers" mask="ModMask" /> - <field type="CARD8" name="modifier_device" /> + <field type="CARD8" name="modifier_device" altenum="ModifierDevice" /> <field type="CARD8" name="grabbed_device" /> <field type="CARD8" name="key" altenum="Grab" /> <field type="CARD8" name="this_device_mode" enum="GrabMode" /> @@ -361,7 +453,7 @@ authorization from the authors. <request name="UngrabDeviceKey" opcode="16"> <field type="WINDOW" name="grabWindow" /> <field type="CARD16" name="modifiers" mask="ModMask" /> - <field type="CARD8" name="modifier_device" /> + <field type="CARD8" name="modifier_device" altenum="ModifierDevice" /> <field type="CARD8" name="key" altenum="Grab" /> <field type="CARD8" name="grabbed_device" /> </request> @@ -371,13 +463,13 @@ authorization from the authors. <request name="GrabDeviceButton" opcode="17"> <field type="WINDOW" name="grab_window" /> <field type="CARD8" name="grabbed_device" /> - <field type="CARD8" name="modifier_device" /> + <field type="CARD8" name="modifier_device" altenum="ModifierDevice" /> <field type="CARD16" name="num_classes" /> <field type="CARD16" name="modifiers" mask="ModMask" /> <field type="CARD8" name="this_device_mode" enum="GrabMode" /> <field type="CARD8" name="other_device_mode" enum="GrabMode" /> <field type="CARD8" name="button" altenum="Grab" /> - <field type="CARD8" name="owner_events" /> + <field type="BOOL" name="owner_events" /> <pad bytes="2" /> <list type="EventClass" name="classes"> <fieldref>num_classes</fieldref> @@ -389,9 +481,10 @@ authorization from the authors. <request name="UngrabDeviceButton" opcode="18"> <field type="WINDOW" name="grab_window" /> <field type="CARD16" name="modifiers" mask="ModMask" /> - <field type="CARD8" name="modifier_device" /> + <field type="CARD8" name="modifier_device" altenum="ModifierDevice" /> <field type="CARD8" name="button" altenum="Grab" /> <field type="CARD8" name="grabbed_device" /> + <pad bytes="3" /> </request> <!-- AllowDeviceEvents --> @@ -409,6 +502,7 @@ authorization from the authors. <field type="TIMESTAMP" name="time" altenum="Time" /> <field type="CARD8" name="mode" enum="DeviceInputMode" /> <field type="CARD8" name="device_id" /> + <pad bytes="2" /> </request> <!-- GetDeviceFocus --> @@ -417,7 +511,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="WINDOW" name="focus" altenum="InputFocus" /> <field type="TIMESTAMP" name="time" /> <field type="CARD8" name="revert_to" enum="InputFocus" /> @@ -432,6 +526,7 @@ authorization from the authors. <field type="TIMESTAMP" name="time" altenum="Time" /> <field type="CARD8" name="revert_to" enum="InputFocus" /> <field type="CARD8" name="device_id" /> + <pad bytes="2" /> </request> <!-- GetFeedbackControl --> @@ -526,7 +621,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD16" name="num_feedbacks" /> <pad bytes="22" /> <list type="FeedbackState" name="feedbacks"> @@ -609,8 +704,24 @@ authorization from the authors. </list> </struct> + <enum name="ChangeFeedbackControlMask"> + <item name="KeyClickPercent"> <bit>0</bit> </item> <!-- 0x01 --> + <item name="Percent"> <bit>1</bit> </item> <!-- 0x02 --> + <item name="Pitch"> <bit>2</bit> </item> <!-- 0x04 --> + <item name="Duration"> <bit>3</bit> </item> <!-- 0x08 --> + <item name="Led"> <bit>4</bit> </item> <!-- 0x10 --> + <item name="LedMode"> <bit>5</bit> </item> <!-- 0x20 --> + <item name="Key"> <bit>6</bit> </item> <!-- 0x40 --> + <item name="AutoRepeatMode"> <bit>7</bit> </item> <!-- 0x80 --> + <item name="String"> <bit>0</bit> </item> <!-- 0x01 --> + <item name="Integer"> <bit>0</bit> </item> <!-- 0x01 --> + <item name="AccelNum"> <bit>0</bit> </item> <!-- 0x01 --> + <item name="AccelDenom"> <bit>1</bit> </item> <!-- 0x02 --> + <item name="Threshold"> <bit>2</bit> </item> <!-- 0x04 --> + </enum> + <request name="ChangeFeedbackControl" opcode="23"> - <field type="CARD32" name="mask" /> + <field type="CARD32" name="mask" mask="ChangeFeedbackControlMask" /> <field type="CARD8" name="device_id" /> <field type="CARD8" name="feedback_id" /> <pad bytes="2" /> @@ -623,8 +734,9 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <field type="KeyCode" name="first_keycode" /> <field type="CARD8" name="count" /> + <pad bytes="1" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="keysyms_per_keycode" /> <pad bytes="23" /> <list type="KEYSYM" name="keysyms"> @@ -655,7 +767,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="keycodes_per_modifier" /> <pad bytes="23" /> <list type="CARD8" name="keymaps"> @@ -680,7 +792,7 @@ authorization from the authors. </op> </list> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" enum="MappingStatus" /> <pad bytes="23" /> </reply> @@ -692,12 +804,13 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="map_size" /> <pad bytes="23" /> <list type="CARD8" name="map"> <fieldref>map_size</fieldref> </list> + <pad align="4" /> </reply> </request> @@ -711,7 +824,7 @@ authorization from the authors. <fieldref>map_size</fieldref> </list> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" enum="MappingStatus" /> <pad bytes="23" /> </reply> @@ -739,11 +852,16 @@ authorization from the authors. </list> </struct> + <enum name="ValuatorStateModeMask"> + <item name="DeviceModeAbsolute"> <bit>0</bit> </item> + <item name="OutOfProximity"> <bit>1</bit> </item> + </enum> + <struct name="ValuatorState"> <field type="CARD8" name="class_id" enum="InputClass" /> <field type="CARD8" name="len" /> <field type="CARD8" name="num_valuators" /> - <field type="CARD8" name="mode" /> + <field type="CARD8" name="mode" mask="ValuatorStateModeMask" /> <list type="CARD32" name="valuators"> <fieldref>num_valuators</fieldref> </list> @@ -766,7 +884,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="num_classes" /> <pad bytes="23" /> <list type="InputState" name="classes"> @@ -815,7 +933,7 @@ authorization from the authors. <fieldref>num_valuators</fieldref> </list> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" enum="GrabStatus" /> <pad bytes="23" /> </reply> @@ -901,7 +1019,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="1" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" altenum="GrabStatus" /> <pad bytes="23" /> <field type="DeviceState" name="control" /> @@ -976,7 +1094,7 @@ authorization from the authors. <pad bytes="1" /> <field type="DeviceCtl" name="control" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD8" name="status" altenum="GrabStatus" /> <pad bytes="23" /> </reply> @@ -990,7 +1108,7 @@ authorization from the authors. <field type="CARD8" name="device_id" /> <pad bytes="3" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="CARD16" name="num_atoms" /> <pad bytes="22" /> <list type="ATOM" name="atoms"> @@ -1017,28 +1135,26 @@ authorization from the authors. <field type="CARD32" name="num_items" /> <switch name="items"> <fieldref>format</fieldref> - <!-- <bitcase> is not correct, this would need <cases>s. - It works in that case, because PropertyFormat items can be - distinguished exactly as their values don't have equal bits. - --> - <bitcase> + <case> <enumref ref="PropertyFormat">8Bits</enumref> <list type="CARD8" name="data8"> <fieldref>num_items</fieldref> </list> - </bitcase> - <bitcase> + <pad align="4" /> + </case> + <case> <enumref ref="PropertyFormat">16Bits</enumref> <list type="CARD16" name="data16"> <fieldref>num_items</fieldref> </list> - </bitcase> - <bitcase> + <pad align="4" /> + </case> + <case> <enumref ref="PropertyFormat">32Bits</enumref> <list type="CARD32" name="data32"> <fieldref>num_items</fieldref> </list> - </bitcase> + </case> </switch> </request> @@ -1061,7 +1177,7 @@ authorization from the authors. <field type="BOOL" name="delete" /> <pad bytes="2" /> <reply> - <pad bytes="1" /> + <field type="CARD8" name="xi_reply_type" /> <field type="ATOM" name="type" /> <field type="CARD32" name="bytes_after" /> <field type="CARD32" name="num_items" /> @@ -1079,12 +1195,14 @@ authorization from the authors. <list type="CARD8" name="data8"> <fieldref>num_items</fieldref> </list> + <pad align="4" /> </bitcase> <bitcase> <enumref ref="PropertyFormat">16Bits</enumref> <list type="CARD16" name="data16"> <fieldref>num_items</fieldref> </list> + <pad align="4" /> </bitcase> <bitcase> <enumref ref="PropertyFormat">32Bits</enumref> @@ -1131,7 +1249,7 @@ authorization from the authors. <field type="FP1616" name="root_y" /> <field type="FP1616" name="win_x" /> <field type="FP1616" name="win_y" /> - <field type="CARD8" name="same_screen" /> + <field type="BOOL" name="same_screen" /> <pad bytes="1" /> <field type="CARD16" name="buttons_len" /> <field type="ModifierInfo" name="mods" /> @@ -1184,11 +1302,12 @@ authorization from the authors. <field type="CARD16" name="type" enum="HierarchyChangeType" /> <field type="CARD16" name="len" /> <field type="CARD16" name="name_len" /> - <field type="CARD8" name="send_core" /> - <field type="CARD8" name="enable" /> + <field type="BOOL" name="send_core" /> + <field type="BOOL" name="enable" /> <list type="char" name="name"> <fieldref>name_len</fieldref> </list> + <pad align="4" /> </struct> <struct name="RemoveMaster"> @@ -1392,7 +1511,7 @@ authorization from the authors. <field type="CARD16" name="number" /> <field type="CARD16" name="scroll_type" enum="ScrollType" /> <pad bytes="2" /> - <field type="CARD32" name="flags" enum="ScrollFlags" /> + <field type="CARD32" name="flags" mask="ScrollFlags" /> <field type="FP3232" name="increment" /> </struct> @@ -1436,26 +1555,16 @@ authorization from the authors. <struct name="XIDeviceInfo"> <field type="DeviceId" name="deviceid" altenum="Device" /> - <field type="CARD16" name="type" altenum="DeviceType" /> + <field type="CARD16" name="type" enum="DeviceType" /> <field type="DeviceId" name="attachment" altenum="Device" /> <field type="CARD16" name="num_classes" /> <field type="CARD16" name="name_len" /> <field type="BOOL" name="enabled" /> <pad bytes="1" /> <list type="char" name="name"> - <!-- name_len is without padding, so we've to pad on our own, - auto align pad after the list would be helpfull --> - <op op="*"> - <op op="/"> - <op op="+"> - <fieldref>name_len</fieldref> - <value>3</value> - </op> - <value>4</value> - </op> - <value>4</value> - </op> + <fieldref>name_len</fieldref> </list> + <pad align="4" /> <list type="DeviceClass" name="classes"> <fieldref>num_classes</fieldref> </list> @@ -1579,6 +1688,7 @@ authorization from the authors. </struct> <request name="XIPassiveGrabDevice" opcode="54"> + <!-- field "time" is unused and its value is undefined --> <field type="TIMESTAMP" name="time" altenum="Time" /> <field type="WINDOW" name="grab_window" /> <field type="CURSOR" name="cursor" /> @@ -1708,12 +1818,14 @@ authorization from the authors. <list type="CARD8" name="data8"> <fieldref>num_items</fieldref> </list> + <pad align="4" /> </bitcase> <bitcase> <enumref ref="PropertyFormat">16Bits</enumref> <list type="CARD16" name="data16"> <fieldref>num_items</fieldref> </list> + <pad align="4" /> </bitcase> <bitcase> <enumref ref="PropertyFormat">32Bits</enumref> @@ -1772,6 +1884,12 @@ authorization from the authors. </list> </event> + <!-- the highest bit in a CARD8 device_id-field indicates that more + events will follow --> + <enum name="MoreEventsMask"> + <item name="MoreEvents"> <bit>7</bit> </item> <!-- 0x80 --> + </enum> + <event name="DeviceKeyPress" number="1"> <field type="BYTE" name="detail" /> <field type="TIMESTAMP" name="time" /> @@ -1782,9 +1900,9 @@ authorization from the authors. <field type="INT16" name="root_y" /> <field type="INT16" name="event_x" /> <field type="INT16" name="event_y" /> - <field type="CARD16" name="state" /> + <field type="CARD16" name="state" mask="KeyButMask" /> <field type="BOOL" name="same_screen" /> - <field type="CARD8" name="device_id" /> + <field type="CARD8" name="device_id" altmask="MoreEventsMask" /> </event> <eventcopy name="DeviceKeyRelease" number="2" ref="DeviceKeyPress" /> @@ -1805,13 +1923,25 @@ authorization from the authors. <eventcopy name="ProximityIn" number="8" ref="DeviceKeyPress" /> <eventcopy name="ProximityOut" number="9" ref="DeviceKeyPress" /> + <enum name="ClassesReportedMask"> + <item name="OutOfProximity"> <bit>7</bit> </item> <!-- 0x80 --> + <!-- 0 = InProxmity, 1 = OutOfProximity --> + + <item name="DeviceModeAbsolute"> <bit>6</bit> </item> <!-- 0x40 --> + <!-- 0 = Relative, 1 = Absolute --> + + <item name="ReportingValuators"> <bit>2</bit> </item> <!-- 0x04 --> + <item name="ReportingButtons"> <bit>1</bit> </item> <!-- 0x02 --> + <item name="ReportingKeys"> <bit>0</bit> </item> <!-- 0x01 --> + </enum> + <event name="DeviceStateNotify" number="10"> - <field type="BYTE" name="device_id" /> + <field type="BYTE" name="device_id" altmask="MoreEventsMask" /> <field type="TIMESTAMP" name="time" /> <field type="CARD8" name="num_keys" /> <field type="CARD8" name="num_buttons" /> <field type="CARD8" name="num_valuators" /> - <field type="CARD8" name="classes_reported" /> + <field type="CARD8" name="classes_reported" mask="ClassesReportedMask" /> <list type="CARD8" name="buttons"> <value>4</value> </list> @@ -1825,7 +1955,7 @@ authorization from the authors. <event name="DeviceMappingNotify" number="11"> <field type="BYTE" name="device_id" /> - <field type="CARD8" name="request" /> + <field type="CARD8" name="request" enum="Mapping" /> <field type="KeyCode" name="first_keycode" /> <field type="CARD8" name="count" /> <pad bytes="1" /> @@ -1833,22 +1963,27 @@ authorization from the authors. <pad bytes="20" /> </event> + <enum name="ChangeDevice"> + <item name="NewPointer"> <value>0</value> </item> + <item name="NewKeyboard"> <value>1</value> </item> + </enum> + <event name="ChangeDeviceNotify" number="12"> <field type="BYTE" name="device_id" /> <field type="TIMESTAMP" name="time" /> - <field type="CARD8" name="request" /> + <field type="CARD8" name="request" enum="ChangeDevice" /> <pad bytes="23" /> </event> <event name="DeviceKeyStateNotify" number="13"> - <field type="BYTE" name="device_id" /> + <field type="BYTE" name="device_id" altmask="MoreEventsMask" /> <list type="CARD8" name="keys"> <value>28</value> </list> </event> <event name="DeviceButtonStateNotify" number="14"> - <field type="BYTE" name="device_id" /> + <field type="BYTE" name="device_id" altmask="MoreEventsMask" /> <list type="CARD8" name="buttons"> <value>28</value> </list> @@ -2016,8 +2151,8 @@ authorization from the authors. <field type="FP1616" name="root_y" /> <field type="FP1616" name="event_x" /> <field type="FP1616" name="event_y" /> - <field type="CARD8" name="same_screen" /> - <field type="CARD8" name="focus" /> + <field type="BOOL" name="same_screen" /> + <field type="BOOL" name="focus" /> <field type="CARD16" name="buttons_len" /> <field type="ModifierInfo" name="mods" /> <field type="GroupInfo" name="group" /> @@ -2208,6 +2343,11 @@ authorization from the authors. <!-- ⋅⋅⋅ Events (v2.3) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ --> + <enum name="BarrierFlags"> + <item name="PointerReleased"> <bit>0</bit> </item> + <item name="DeviceIsGrabbed"> <bit>1</bit> </item> + </enum> + <event name="BarrierHit" number="25" xge="true"> <field type="DeviceId" name="deviceid" altenum="Device" /> <field type="TIMESTAMP" name="time" altenum="Time" /> @@ -2218,7 +2358,7 @@ authorization from the authors. <field type="BARRIER" name="barrier" /> <!-- 32 byte boundary --> <field type="CARD32" name="dtime" /> - <field type="CARD32" name="flags" /> + <field type="CARD32" name="flags" mask="BarrierFlags" /> <field type="DeviceId" name="sourceid" altenum="Device" /> <pad bytes="2" /> <field type="FP1616" name="root_x" /> 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. |