Commit graph

80 commits

Author SHA1 Message Date
Dylan Baker
4cf566ba74 xcb-errors.pc.in: Actually set the required version of xcb 2024-12-03 11:49:43 -08:00
Dylan Baker
93985c5bc5 xcb-errors.pc.in: Remove unused @LIBS@ from libs 2024-12-03 11:49:43 -08:00
Dylan Baker
31a14a5d74 extensions.py: write to a temp file name, then move the file on success
This removes the need to do this in the Makefile, which also makes
rebuilds work with the early exit approaching (coming next).
2024-12-03 11:49:33 -08:00
Dylan Baker
fb5cbabb2e make: Mark extensions.c as always out of date
This is required to ensure that changes to the xml files on disk are
reliably detected in a rebuild situation
2024-12-03 11:21:15 -08:00
Dylan Baker
c864a44e36 extensions.py: on rebuild only rewrite the file if inputs have changed
Since we need to glob the inputs we can't really know if anything has
changed, since a new file won't be registered unless the target runs
again. To avoid causing additional recompilation and linking, we only
actually write the generated .c if the inputs have changed, otherwise we
leave early, which results in the old file being used.
2024-12-03 11:21:15 -08:00
Dylan Baker
7893efb241 extensions.py: move globbing into python script
This will be helpful for Meson, which doesn't do globing in it's DSL
2024-12-03 11:21:15 -08:00
Dylan Baker
c4c32acbae extensions.py: use argparse for arguments
We're going to make more use of this later
2024-12-03 11:21:15 -08:00
Dylan Baker
f25753ddd0 extensions.py: do away with a few more globals 2024-12-03 11:21:15 -08:00
Dylan Baker
cd3b9f5851 extensions.py: use str.format and f-strings
This bumps the required python version to 3.9, which is the oldest
supported version at the time of writing. This also switches some
strings to '' instead of "", to avoid escaping nested "
("\"foo\"" -> '"foo"')
2024-12-03 11:21:15 -08:00
Dylan Baker
50dffa45b2 extensions.py: remove stray ; 2024-12-03 11:21:15 -08:00
Dylan Baker
66b2420aed extensions.py: use resource manager for files 2024-12-03 11:21:15 -08:00
Dylan Baker
79dac6d3d8 extensions.py: use a main function to be more idiomatic 2024-12-03 11:21:15 -08:00
Dylan Baker
d63f2942c1 extensions.py: pass output by reference
Instead of using a global for it.
2024-12-03 11:21:15 -08:00
Dylan Baker
0a86215ac8 extensions.py: use x in set instead of x == y or x == z...
This does bump the required python to 2.7, but given that anything older
than 3.8 is currently EOL... that seems fine.
2024-12-03 11:21:15 -08:00
Alan Coopersmith
d5435b07a8 Update submodule URL from anongit to gitlab
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb-errors/-/merge_requests/7>
2024-09-07 11:35:30 -07:00
Alan Coopersmith
de938c69f3 gitlab CI: Use Xvfb to allow all tests to run
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-12-13 00:47:31 +00:00
Uli Schlachter
fad9c433f5 Fix tests
The tests also use some non-existing events to check that these are
handled correctly. Then came XI 2.4 and introduced several new events,
which broke the test.

Fix this by updating the test accordingly.

This means tests will now fail when using an older version of xcb-proto.
If you are affected by this, either do not run tests, or build against a
newer version of xcb-proto.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-12-08 17:43:53 +01:00
Alan Coopersmith
f85a73865a Add README.md
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-18 18:23:00 -07:00
Alan Coopersmith
517dd82c07
xcb-util-errors 1.0.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-18 18:10:25 -07:00
Mihail Konev
8a2812f603 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:07:36 -07:00
Emil Velikov
f968311042 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Peter Hutterer
0fb1c07367 autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
50574404bd autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
3de8874f5d configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
b33178bb4a gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-20 15:24:15 -07:00
Alan Coopersmith
e2bfc8115d Update m4 to xorg/util/xcb-util-m4@c617eee22ae5c285e79e81
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-20 14:58:19 -07:00
Alan Coopersmith
4440550baf Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters
configure.ac:33: warning: AC_OUTPUT should be used without arguments.
configure.ac:33: You should run autoupdate.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-18 10:20:08 -07:00
Alan Coopersmith
a40b2df701 Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-18 10:19:06 -07:00
Uli Schlachter
5d660ebe87 Do not distribute extensions.c and fix out-of-tree builds
It all started with src/extensions.c being distributed. Thanks to this, tarballs
shipped with this generated file and actually building this file was skipped.
Fix this by using the nodist_ variant of the SOURCES variable.

Due to this oversight (sorry!), the out-of-tree build wasn't actually tested.
The rule that generates src/extensions.c was missing $(srcdir) in front of the
path to extensions.py. This rule is now fixed and, as suggested by Daphne
Pfister, also changed to explicitly call the python interpreter. Configure is
changed to look for it.

Finally, extensions.c couldn't include errors.h. This worked before, because the
C compiler automatically looks for headers in the same directory as the source
file. However, for out-of-tree builds, the source directory and build directory
are different. Paper over this problem by explicitly making it look in the right
directory.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90328
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-05-06 08:16:54 +02:00
Uli Schlachter
332f357aa6 set version to 1.0
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-26 16:07:45 +02:00
Uli Schlachter
33fdb244ed Add COPYING file
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-26 15:59:16 +02:00
Uli Schlachter
7e5cb24eb4 tests: Add some XFixes-based tests
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-06 16:44:45 +02:00
Uli Schlachter
5f13d59080 Add xcb-proto version to xcb-errors.pc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-06 16:37:22 +02:00
Uli Schlachter
4911a0c8c3 Also add a test for maximum major code
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-06 16:28:08 +02:00
Uli Schlachter
ac6b8d8912 Re-add a missing length check
This check was accidentally removed in commit 4ed12c46de.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-06 16:18:22 +02:00
Uli Schlachter
54e2145e11 Ignore "event sent" flag in event codes
The highest bit of an event code shows if the event was generated by the X11
server or via the SendEvent request. Ignore this bit in all places that handle
event codes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-06 16:16:32 +02:00
Uli Schlachter
0095e43185 Update doxygen comments
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 14:59:16 +02:00
Uli Schlachter
594120dff4 Rename *_get_name_for_event()
Now that there are three different functions for querying information about
events, there shouldn't be one which monopolizes on the "_for_event" name.
Instead, the preferred API is the "_for_xcb_event" function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 14:39:20 +02:00
Uli Schlachter
861fc2c169 Handle NULL as context argument
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 14:37:24 +02:00
Uli Schlachter
64fa1e695b Use unchecked QueryExtension requests
If this ever causes an error, the underlying event loop at least gets the chance
to print something useful.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 14:13:34 +02:00
Uli Schlachter
2d0d25aae0 Update KNOWN_ISSUES (and turn it more into a TODO)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 14:02:01 +02:00
Uli Schlachter
964a2b5350 Add a function for figuring out information about an event struct
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 13:49:07 +02:00
Uli Schlachter
63ca7f6c88 tests: Use attribute((format(printf,x,y))) if possible
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 13:46:23 +02:00
Uli Schlachter
88cebd842e API docs: Clarify when NULL is returned
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 13:45:23 +02:00
Uli Schlachter
58b38aff25 Fix copy&paste error
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-05 13:41:20 +02:00
Uli Schlachter
b82a03f403 Test: Factor out string-comparision helper function
This function compares strings, handles NULL (almost) correctly, prints an error
if a mismatch occurs and returns a suitable int result.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-04 23:18:03 +02:00
Uli Schlachter
3a6db57743 Test suite: Add tests for XGE event handling
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-04 17:37:47 +02:00
Uli Schlachter
cd2372e6ba Add a function for handling XGE events
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-04 17:37:10 +02:00
Uli Schlachter
a66bb6b232 Code generator: Add support for XGE events
This also pretends that XKB has XGE events since that extension has its own
event multiplexing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-04 17:28:36 +02:00
Uli Schlachter
5cf2876228 Save static info as a pointer instead of copying it
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-04-04 16:51:35 +02:00