Use the new flagged marshal+destroy function in generated code.
It's intended as a replacement for all existing wl_proxy_marshal_*
functions, so I've used it to replace them all. This results in a large
update to the scanner test files as well.
We now pass the new WL_MARSHAL_FLAG_DESTROY flag when appropriate, so
the race condition in #86 caused by releasing the display mutex between
marshalling the proxy and destroying the proxy is now gone.
Fixes#86
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This previously would have caused a memory leak and incorrect
comments.
Signed-off-by: James Legg <lankyleggy@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is the style used in wayland.xml which is the only file we really
care about for git blame information. So let's adjust all others to that
style for consistency and fix editorconfig to avoid messing this up in
the future.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This allows to include client and server headers in the same file
fixing warnings like
In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16,
from ../src/desktop.h:16,
from ../src/server.h:13,
from ../tests/testlib.c:8:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:80:34: warning: redundant redeclaration of ‘zwlr_layer_shell_v1_interface’ [-Wredundant-decls]
80 | extern const struct wl_interface zwlr_layer_shell_v1_interface;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/testlib.h:8,
from ../tests/testlib.c:7:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:77:34: note: previous declaration of ‘zwlr_layer_shell_v1_interface’ was here
77 | extern const struct wl_interface zwlr_layer_shell_v1_interface;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../subprojects/wlroots/include/wlr/types/wlr_layer_shell_v1.h:16,
from ../src/desktop.h:16,
from ../src/server.h:13,
from ../tests/testlib.c:8:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-protocol.h:106:34: warning: redundant redeclaration of ‘zwlr_layer_surface_v1_interface’ [-Wredundant-decls]
106 | extern const struct wl_interface zwlr_layer_surface_v1_interface;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../tests/testlib.h:8,
from ../tests/testlib.c:7:
tests/59830eb@@footest@sta/wlr-layer-shell-unstable-v1-client-protocol.h:103:34: note: previous declaration of ‘zwlr_layer_surface_v1_interface’ was here
103 | extern const struct wl_interface zwlr_layer_surface_v1_interface;
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Closes: #158
When doing unity builds via meson (example project:
https://github.com/swaywm/sway) multiple source files are glued together
via #include directives. Having every wayland-scanner generated source
file have an identifier named '*types[]' will lead to errors in these
unity builds if two or more of these are joined.
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
The test runs wayland_scanner on a set of XML protocol files which
have malformed element names, and confirms that an error is produced
and indicates the correct line.
Copyright notifications are not included in the test files, as
they are not code; of course, the project license still applies.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Commit e501230d1d "scanner: Fix broken
private-code generation" changed the scanner output without updating the
reference output for scanner tests.
Update the reference data. This fixes 'make check'.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
First one is deprecated in favour of the second option.
The latter is newly introduced and annotates the generated symbols
accordingly.
v2: Don't introduce small-public-code.c - reuse small-code.c (Pekka)
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Unlike a wheel rotation, a wheel tilt is a discrete-only axis. Wheel rotations
are mapped to degrees in libinput but that that does not apply to wheel tilt
axes where there is no physical equivalent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
This was already in the DTD but not supported by the scanner.
The check for ever-increasing "since" tags is not strictly required for enum
entries as we control the binary value. But it keeps the xml file in
good order, preventing things like:
<entry name="first" value="…" />
<entry name="second" value="…" since="3"/>
<entry name="third" value="…" since="2"/>
<entry name="fourth" value="…" since="3"/>
If this is undesirable in the future the check can be removed without
side-effects.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
These are the protocol.xml changes from:
66a26aeb2a: protocol: Remove inconsistent line breaks
a26ed0949e: protocol: indentation fixes
6a18a87727: protocol: Extend wl_touch with touchpoint shape and orientation
and a few other, smaller ones.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch adds the input and reference output data files for the
wayland-scanner tests to be added by the following patch.
The data files are split into their own patch because they are extremely
uninteresting to review:
- example.xml is just a copy wayland.xml from 1.12.0
- small.xml is a tiny dummy definition used for testing scanner
variations without causing lots of big output files
- the other files are wayland-scanner products from the xml files
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
v2: update output due to 2c6350beb9
Acked-by: Yong Bakos <ybakos@humanoriented.com>