From 6b0010bc7622d889f9f972dfd97582c267b5b1aa Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 17 Jul 2022 08:19:04 +0000 Subject: Update xcb-protos to 1.15.2 --- proto/xcb-proto/Makefile.am | 2 +- proto/xcb-proto/configure.ac | 5 +- proto/xcb-proto/doc/xml-xcb.txt | 21 +++++- proto/xcb-proto/py-compile | 74 ++++++++++++++----- proto/xcb-proto/src/Makefile.am | 1 + proto/xcb-proto/src/dbe.xml | 152 +++++++++++++++++++++++++++++++++++++++ proto/xcb-proto/src/dri3.xml | 9 ++- proto/xcb-proto/src/glx.xml | 2 + proto/xcb-proto/src/xcb.xsd | 8 +++ proto/xcb-proto/src/xfixes.xml | 22 +++++- proto/xcb-proto/src/xinput.xml | 100 ++++++++++++++++++++++++-- proto/xcb-proto/src/xprint.xml | 8 +-- proto/xcb-proto/src/xproto.xml | 13 ++-- proto/xcb-proto/xcb-proto.pc.in | 2 +- proto/xcb-proto/xcbgen/xtypes.py | 22 ++++++ 15 files changed, 398 insertions(+), 43 deletions(-) create mode 100644 proto/xcb-proto/src/dbe.xml diff --git a/proto/xcb-proto/Makefile.am b/proto/xcb-proto/Makefile.am index 0312e7ad8..8b57a83fe 100644 --- a/proto/xcb-proto/Makefile.am +++ b/proto/xcb-proto/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = src xcbgen -pkgconfigdir = $(libdir)/pkgconfig +pkgconfigdir = $(datarootdir)/pkgconfig pkgconfig_DATA = xcb-proto.pc EXTRA_DIST=doc xcb-proto.pc.in autogen.sh README.md diff --git a/proto/xcb-proto/configure.ac b/proto/xcb-proto/configure.ac index ac0581287..27a85da30 100644 --- a/proto/xcb-proto/configure.ac +++ b/proto/xcb-proto/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ(2.57) AC_INIT([XCB Proto], - 1.14.1, + 1.15.2, [xcb@lists.freedesktop.org]) AC_CONFIG_SRCDIR([xcb-proto.pc.in]) AM_INIT_AUTOMAKE([foreign dist-xz]) @@ -19,4 +19,5 @@ AM_PATH_PYTHON([2.5]) xcbincludedir='${datadir}/xcb' AC_SUBST(xcbincludedir) -AC_OUTPUT([Makefile src/Makefile xcbgen/Makefile xcb-proto.pc]) +AC_CONFIG_FILES([Makefile src/Makefile xcbgen/Makefile xcb-proto.pc]) +AC_OUTPUT diff --git a/proto/xcb-proto/doc/xml-xcb.txt b/proto/xcb-proto/doc/xml-xcb.txt index f5b9aed13..baef73416 100644 --- a/proto/xcb-proto/doc/xml-xcb.txt +++ b/proto/xcb-proto/doc/xml-xcb.txt @@ -65,8 +65,8 @@ Top-Level Elements This element represents a data structure. The name attribute gives the name of the structure. The content represents the fields of the structure, and - consists of one or more of the field, pad, and list elements described in - the section "Structure Contents" below. + consists of one or more of the length, field, pad, and list elements described + in the section "Structure Contents" below. structure contents @@ -215,6 +215,23 @@ enum; the value is restricted to one of the constants named in the enum. declares the data type of the field, and the name attribute gives the name of the field. +expression + This element overrides the length of the data structure by specifying it + explicitly instead of it being defined by the layout of the structure. + This makes it possible to handle structures with conditional fields + (see the element) where the future revisions of protocols may + introduce new variants and old code must still properly ignore them. + + The content is an expression giving the length of the data structure in terms + of other fields in the structure. See the section "Expressions" for details + on the expression representation. + + The expression must not depend on conditional fields. + + Additionally, the length of the data structure must be at least such that it + includes the fields that the expression depends on. Smaller length is + considered a violation of the protocol. + This element represents a file descriptor field passed with the request. The diff --git a/proto/xcb-proto/py-compile b/proto/xcb-proto/py-compile index 9f8baf7ab..5a8e4e3d9 100644 --- a/proto/xcb-proto/py-compile +++ b/proto/xcb-proto/py-compile @@ -1,9 +1,9 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2018-03-07.03; # UTC +scriptversion=2021-02-27.01; # UTC -# Copyright (C) 2000-2018 Free Software Foundation, Inc. +# Copyright (C) 2000-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ scriptversion=2018-03-07.03; # UTC # bugs to or send patches to # . -if [ -z "$PYTHON" ]; then +if test -z "$PYTHON"; then PYTHON=python fi @@ -96,27 +96,44 @@ done files=$* if test -z "$files"; then - usage_error "no files given" + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before # byte compilation. -if [ -z "$basedir" ]; then - pathtrans="path = file" +if test -z "$basedir"; then + pathtrans="path = file" else - pathtrans="path = os.path.join('$basedir', file)" + pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. -if [ -z "$destdir" ]; then - filetrans="filepath = path" +if test -z "$destdir"; then + filetrans="filepath = path" else - filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" +fi + +python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'` +if test -z "$python_major"; then + echo "$me: could not determine $PYTHON major version, guessing 3" >&2 + python_major=3 +fi + +# The old way to import libraries was deprecated. +if test "$python_major" -le 2; then + import_lib=imp + import_test="hasattr(imp, 'get_tag')" + import_call=imp.cache_from_source +else + import_lib=importlib + import_test="hasattr(sys.implementation, 'cache_tag')" + import_call=importlib.util.cache_from_source fi $PYTHON -c " -import sys, os, py_compile, imp +import sys, os, py_compile, $import_lib files = '''$files''' @@ -129,18 +146,18 @@ for file in files.split(): continue sys.stdout.write(file) sys.stdout.flush() - if hasattr(imp, 'get_tag'): - py_compile.compile(filepath, imp.cache_from_source(filepath), path) + if $import_test: + py_compile.compile(filepath, $import_call(filepath), path) else: py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " -import sys, os, py_compile, imp +import sys, os, py_compile, $import_lib # pypy does not use .pyo optimization -if hasattr(sys, 'pypy_translation_info'): +if hasattr(sys, 'pypy_translation_info') and sys.hexversion < 0x03050000: sys.exit(0) files = '''$files''' @@ -153,12 +170,35 @@ for file in files.split(): continue sys.stdout.write(file) sys.stdout.flush() - if hasattr(imp, 'get_tag'): - py_compile.compile(filepath, imp.cache_from_source(filepath, False), path) + if $import_test: + py_compile.compile(filepath, $import_call(filepath), path) else: py_compile.compile(filepath, filepath + 'o', path) sys.stdout.write('\n')" 2>/dev/null || : +$PYTHON -OO -c " +import sys, os, py_compile, $import_lib + +# python<3.5 does not have split files for -O and -OO +if sys.hexversion < 0x03050000: + sys.exit(0) + +files = '''$files''' +sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') +for file in files.split(): + $pathtrans + $filetrans + if not os.path.exists(filepath) or not (len(filepath) >= 3 + and filepath[-3:] == '.py'): + continue + sys.stdout.write(file) + sys.stdout.flush() + if $import_test: + py_compile.compile(filepath, $import_call(filepath), path) + else: + py_compile.compile(filepath, filepath + 'o', path) +sys.stdout.write('\n')" 2>/dev/null || exit $? + # Local Variables: # mode: shell-script # sh-indentation: 2 diff --git a/proto/xcb-proto/src/Makefile.am b/proto/xcb-proto/src/Makefile.am index d81d818a6..aa1086084 100644 --- a/proto/xcb-proto/src/Makefile.am +++ b/proto/xcb-proto/src/Makefile.am @@ -4,6 +4,7 @@ xcbinclude_HEADERS = \ bigreq.xml \ composite.xml \ damage.xml \ + dbe.xml \ dpms.xml \ dri2.xml \ dri3.xml \ diff --git a/proto/xcb-proto/src/dbe.xml b/proto/xcb-proto/src/dbe.xml new file mode 100644 index 000000000..8e891f455 --- /dev/null +++ b/proto/xcb-proto/src/dbe.xml @@ -0,0 +1,152 @@ + + + + + xproto + + + + + + 0 + 1 + 2 + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + n_infos + + + + + + + + + + + + + + + + + + + + + Queries the version of this extension + + + + + + + + + + + + + Allocates a back buffer + + + + + + + + + + + Deallocates a back buffer + + + + + + + + + n_actions + + + Swaps front and back buffers + + + + + + + + + Begins a logical swap block + + + + + Ends a logical swap block + + + + + + n_drawables + + + + + + + n_supported_visuals + + + Requests visuals that support double buffering + + + + + + + + + + + Gets back buffer attributes + + + + + + diff --git a/proto/xcb-proto/src/dri3.xml b/proto/xcb-proto/src/dri3.xml index 895d12a53..9549fd4b3 100644 --- a/proto/xcb-proto/src/dri3.xml +++ b/proto/xcb-proto/src/dri3.xml @@ -23,7 +23,7 @@ OF THIS SOFTWARE. --> + major-version="1" minor-version="3"> xproto @@ -163,4 +163,11 @@ OF THIS SOFTWARE. + + + + + + + diff --git a/proto/xcb-proto/src/glx.xml b/proto/xcb-proto/src/glx.xml index 2e50aeaa1..9abfc5b76 100644 --- a/proto/xcb-proto/src/glx.xml +++ b/proto/xcb-proto/src/glx.xml @@ -491,6 +491,7 @@ The patch that fixed this server bug in X.org CVS is here: gl_str_len + glx_str_len @@ -527,6 +528,7 @@ The patch that fixed this server bug in X.org CVS is here: gl_str_len + glx_str_len diff --git a/proto/xcb-proto/src/xcb.xsd b/proto/xcb-proto/src/xcb.xsd index dc3d7cc18..86a51c536 100644 --- a/proto/xcb-proto/src/xcb.xsd +++ b/proto/xcb-proto/src/xcb.xsd @@ -101,6 +101,13 @@ authorization from the authors. + + + + + + + @@ -210,6 +217,7 @@ authorization from the authors. + diff --git a/proto/xcb-proto/src/xfixes.xml b/proto/xcb-proto/src/xfixes.xml index 0a3d5ffee..a01cd7b0c 100644 --- a/proto/xcb-proto/src/xfixes.xml +++ b/proto/xcb-proto/src/xfixes.xml @@ -26,7 +26,7 @@ authorization from the authors. --> + major-version="6" minor-version="0"> xproto render shape @@ -359,4 +359,24 @@ authorization from the authors. + + + + + 0 + 0 + + + + + + + + + + + + + + diff --git a/proto/xcb-proto/src/xinput.xml b/proto/xcb-proto/src/xinput.xml index 5f88a9857..7f4074eb0 100644 --- a/proto/xcb-proto/src/xinput.xml +++ b/proto/xcb-proto/src/xinput.xml @@ -33,7 +33,7 @@ authorization from the authors. --> + major-version="2" minor-version="4"> xfixes xproto @@ -1601,6 +1601,7 @@ authorization from the authors. 2 3 8 + 9 @@ -1674,6 +1675,14 @@ authorization from the authors. + + + + + + + + @@ -1689,6 +1698,12 @@ authorization from the authors. + + + len + 4 + + @@ -1746,6 +1761,11 @@ authorization from the authors. + + Gesture + + + @@ -1866,11 +1886,13 @@ authorization from the authors. - 0 - 1 - 2 - 3 - 4 + 0 + 1 + 2 + 3 + 4 + 5 + 6 @@ -2604,6 +2626,72 @@ authorization from the authors. + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proto/xcb-proto/src/xprint.xml b/proto/xcb-proto/src/xprint.xml index f9af65fa6..fa3bb7ff1 100644 --- a/proto/xcb-proto/src/xprint.xml +++ b/proto/xcb-proto/src/xprint.xml @@ -102,7 +102,7 @@ authorization from the authors. printerNameLen - + localeLen @@ -125,7 +125,7 @@ authorization from the authors. printerNameLen - + localeLen @@ -177,11 +177,11 @@ authorization from the authors. len_data - + len_fmt - + len_options diff --git a/proto/xcb-proto/src/xproto.xml b/proto/xcb-proto/src/xproto.xml index 116781e8c..19a8a6ab8 100644 --- a/proto/xcb-proto/src/xproto.xml +++ b/proto/xcb-proto/src/xproto.xml @@ -2981,25 +2981,21 @@ results (no grabs are established) if there is a conflicting grab for any combin ]]> - @@ -3010,7 +3006,8 @@ Another client has already issued a GrabKey with the same button/key combination on the same window. ]]> = (3, 3): + from xml.etree.ElementTree import SubElement +else: + from xml.etree.cElementTree import SubElement + import __main__ verbose_align_log = False @@ -503,6 +510,8 @@ class ComplexType(Type): Public fields added: fields is an array of Field objects describing the structure fields. + length_expr is an expression that defines the length of the structure. + ''' def __init__(self, name, elt): Type.__init__(self, name) @@ -512,6 +521,7 @@ class ComplexType(Type): self.nmemb = 1 self.size = 0 self.lenfield_parent = [self] + self.length_expr = None # get required_start_alignment required_start_align_element = elt.find("required_start_align") @@ -573,6 +583,9 @@ class ComplexType(Type): type = module.get_type('INT32') type.make_fd_of(module, self, fd_name) continue + elif child.tag == 'length': + self.length_expr = Expression(list(child)[0], self) + continue else: # Hit this on Reply continue @@ -1346,6 +1359,15 @@ class Error(ComplexType): if self.required_start_align is None: self.required_start_align = Alignment(4,0) + # All errors are basically the same, but they still got different XML + # for historic reasons. This 'invents' the missing parts. + if len(self.elt) < 1: + SubElement(self.elt, "field", type="CARD32", name="bad_value") + if len(self.elt) < 2: + SubElement(self.elt, "field", type="CARD16", name="minor_opcode") + if len(self.elt) < 3: + SubElement(self.elt, "field", type="CARD8", name="major_opcode") + def add_opcode(self, opcode, name, main): self.opcodes[name] = opcode if main: -- cgit v1.2.3