Commit Graph

13 Commits

Author SHA1 Message Date
shierote
aa6a07c2fe doc: fix typo in wl_data_device.data_offer
Signed-off-by: Taishi Eguchi <taishi2060@gmail.com>
2022-01-10 10:07:22 +00:00
Derek Foreman
0e0274af0c scanner: Use the new atomic marshal/destroy function
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>
2021-08-07 11:53:23 +00:00
James Legg
b7153f2273 tests: Test wayland-scanner with a description in an entry
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>
2021-07-07 12:11:42 +00:00
Peter Hutterer
df969706f4 Replace initial 8 spaces with a tab for all xml files
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>
2020-04-29 12:21:33 +00:00
Guido Günther
cc8b6aa3d9 scanner: Guard interface declarations
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
2020-04-23 10:17:18 +02:00
Marty E. Plummer
9f004d8b0f
scanner: prepend protocol name to types symbol
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>
2019-09-11 13:27:03 -05:00
Manuel Stoeckl
6db761d162 tests: Verify that wayland_scanner can catch bad identifiers
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>
2019-05-02 17:42:59 +00:00
Pekka Paalanen
400df40dfa tests: fix scanner private-code test reference data
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>
2018-02-26 07:35:04 -06:00
Emil Velikov
b02c4013e3 tests: add code, public-code and private-code tests
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>
2018-02-22 13:51:50 +02:00
Peter Hutterer
2f72d0a8a8 protocol: add axis_source.wheel_tilt
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>
2017-01-24 12:00:19 +02:00
Peter Hutterer
f8ab47690c scanner: support "since" attribute for enum entries
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>
2017-01-24 11:59:00 +02:00
Peter Hutterer
493eda337a tests: sync example.xml with wayland.xml
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>
2017-01-24 11:48:46 +02:00
Pekka Paalanen
992b451dc4 tests: add data files for future wayland-scanner test
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>
2016-11-23 10:18:29 +02:00