summaryrefslogtreecommitdiff
path: root/xcbgen/state.py
Commit message (Collapse)AuthorAgeFilesLines
* xcbgen: Use xml.etree.ElementTree for Python >= 3.3.Björn Esser2020-06-041-1/+1
| | | | | | | | | | | | | | In commit 7d58eed95f796fc764741d7549ee2214bbbcc64c we started to use xml.etree.ElementTree for Python >= 3.9. In fact the xml.etree.cElementTree module has already been deprecated since Python 3.3. Given this fact, we should start to use the xml.etree.ElementTree module beginning with Python 3.3. See: https://github.com/python/cpython/commit/a72a98f24a19928e31dcc4cab2cd2ad0f1846e11 Signed-off-by: Björn Esser <besser82@fedoraproject.org>
* xcbgen: xml.etree.cElementTree has been dropped in Python 3.9.Björn Esser2020-06-011-1/+6
| | | | | | It can be replaced with xml.etree.ElementTree safely. Signed-off-by: Björn Esser <besser82@fedoraproject.org>
* Allow access to the original type in the XMLUli Schlachter2019-12-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | xcbgen 'helpfully' transforms things to C types already so that libxcb does not have to do so. Thus, even though the XML says that a field has type CARD8, xcbgen will claim uint8_t. This might be a bit weird, but is so far totally fine. However, the type mapping that xcbgen uses is not injective. All of CARD8, BYTE and BOOL get turned into uint8_t and the original type is lost. This is totally fine for libxcb, but programming languages other than C do have built in boolean types. My personal problem is with Rust, where providing a boolean for an integer argument causes a compiler error. This results in (relatively) ugly "0 / 1" instead of "false / true". This commit adds a new xml_type member to SimpleType. This type contains the original string that appeared in the XML file. Since libxcb creates instances of SimpleType itself and to avoid breaking the API, the new argument to SimpleType.__init__ defaults to None. Signed-off-by: Uli Schlachter <psychon@znc.in>
* add support for eventstructChristian Linhart2017-03-111-0/+41
| | | | | | | | | | eventstruct is a new xml element that allows to use events as part of requests. This is, e.g., needed by the SendExtensionEvent request of the XINPUT extension. Signed-off-by: Christian Linhart <chris@demorecorder.com>
* Also track directly imported modules in a separate listKeith Packard2014-02-191-0/+4
| | | | | | | | | This allows the generated header files to only include the directly referenced header files, with the indirectly referenced header files included by the directly referenced ones. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
* Track pad count at the module levelPeter Harris2014-01-211-0/+1
| | | | | | | | If the pad count is reset for each bitcase, the names will collide in the encompasing switch struct. Reviewed-By: Ran Benita <ran234@gmail.com> Signed-off-by: Peter Harris <pharris@opentext.com>
* Add CARD64/INT64 protocol typesKeith Packard2013-11-061-0/+2
| | | | | | | | No reason to make people use two 32-bit values when every modern compiler has native 64-bit objects. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* Use absolute imports in xcbgen for Python 3 compatibilityDavid Coles2011-05-031-3/+3
| | | | | | | | | Python 3 has stricter syntax for relative imports. Use absolute imports to ensure compatibility with all versions of Python. Also break cyclical module import between state.py and matcher.py by deferring import. Signed-off-by: David Coles <dcoles@gaikai.com> Signed-off-by: Julien Danjou <julien@danjou.info>
* Work around a Python bug involving the file name 'types.py'.Eamon Walsh2008-07-091-1/+1
|
* Add Python parser language-independent parts.Eamon Walsh2008-04-191-0/+166